Hello,
I know is an old topic, but I have bumped into the same issue when playing around with Power Automate Desktop Flows, testing them into an Windows 10 virtual machine.
I had one of these two errors:
"Cannot create new session to execute unattended run."
or
"There is a user session (id: 1, state: Active) on the target machine. Cannot execute unattended desktop flow."
Both errors come up either through the installed gateway either directly using the "machine connection".
In my case the problem was solved using another virtual machine with Windows Server 2019. At least in my case, the flow cannot be ran as "unattended" on Win10 machine, despite the official documentation where in the Prerequisites is stated that Win 10 Pro & Enterprise are also allowed for unattended scenarios.
And every time I have tested the unattended scenario, either I have used the "Sign out" option, either freshly restarted the VM without logging on.
The "attended" scenarios worked without any problem on my Windows 10 Enterprise, but the unattended NOT.
Hope this helps.
Lucian