[Espresso] mobile: uiautomatorPageSource fails

Hi,

According to [Espresso] mobile: uiautomatorPageSource documentation we should be able to retrieve accessibility elements hierarchy tree with UiAutomator framework.

I run an Espresso session and I do this request

POST:   'http://127.0.0.2:4723/session/<ssid>/execute/sync
Header: 'Content-Type: application/json'
Body:
{
    "script": "mobile: uiautomatorPageSource",
    "args" : []
}'

however, I am getting an error which is not expected

{
“value”: {
“error”: “unknown error”,
“message”: “An unknown server-side error occurred while processing the command. Original error: ‘GET /appium/execute_mobile/uiautomator_page_source’ cannot be proxied to Espresso server because the instrumentation process has crashed. Check the Appium server log and the logcat output for more details”,
“stacktrace”: “UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘GET /appium/execute_mobile/uiautomator_page_source’ cannot be proxied to Espresso server because the instrumentation process has crashed. Check the Appium server log and the logcat output for more details
at EspressoProxy.command (/home/user/.nvm/versions/node/v15.11.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:342:13)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at EspressoDriver.mobileUiautomatorPageSource (/home/user/.appium/node_modules/appium-espresso-driver/lib/commands/general.js:255:10)
at EspressoDriver.executeMobile (/home/user/.appium/node_modules/appium-espresso-driver/lib/commands/execute.js:90:10)
at EspressoDriver.execute (/home/user/.appium/node_modules/appium-espresso-driver/node_modules/appium-android-driver/lib/commands/execute.js:10:12)”
}
}

But when I try this in the same session, it works correctly

POST:   'http://127.0.0.2:4723/session/<ssid>/execute/sync
Header: 'Content-Type: application/json'
Body:
{
    "script": "mobile: getDeviceTime",
    "args" : []
}

So the session seems doesn’t have an issue itself, the Appium Inspector works with that session as well.

Am I doing something wrong or it is an issue?

Appium version: 2.0.0-beta.44 with its appropriate Espresso version

logcat output could contain more information about the crash