Are you accessing the resource machine via RDP (mstsc)? RDP is not a suitable access tool and is specifically not recommended by BP. The reason RDP doesn't work with surface automation is that the remote desktop only exists when you have the window open, and is destroyed once the window is closed. After closing the window BP is still running on the remote machine, but there is no UI, so any process that requires the UI (global click, keystroke, screenshot, SA) will encounter problems. You can test this by running a process that captures a screenshot - when the window is closed the screenshot will be black.
One solution is to use a remote access tool where the target machine persists, and is unaffected by you viewing it (see link above).
Another solution is to use Login Agent to log in and to run the process unattended. And if you do connect via RDP, you must run the Log Out and Log In processes to reinstate the remote desktop.