Failure to interact with a Java APP Desktop when UFT is run from an inactive Windows session

I have developed a test that interacts with a Java APP Desktop and the Browser. 

To execute it periodically, I have created a script (.vbs) that creates a UFT object, opens the test, and runs it. I have scheduled this script to run periodically by creating a scheduled task in Windows to execute it daily.

The test works perfectly when I run it directly from UFT and VBS script

The test environment is a Windows Server 2019 virtual machine with UFT version 23.4, using an RDP connection to access the machine.

The test executes perfectly, interacting with both the Java APP Desktop and the web browser, when the script is run manually or from the scheduled task, as long as the RDP session is open and active.

However, when the RDP session is inactive, the automated test starts the Java APP Desktop but is unable to interact with it (e.g., click a button or perform a similar action).

The graphical interface of the Java APP Desktop is developed with the Swing library.

Does anyone have any ideas on how to solve this issue or what workaround to apply?