Application won’t work after disconnecting from RDP

The problem is that my Java Script runs perfectly fine when I have a connection with RDP to my Windows Server but when I disconnect (Clicking X) as title says my Script wont work as expected.

It is recieving the requests from my website but can’t do the tasks properly such as FFMpeg.

Error adding banner to the video: Error: ffmpeg exited with code 1:
at ChildProcess. (C:Usersdurieun02Desktopservernode_modulesfluent-ffmpeglibprocessor.js:182:22)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)

This is just an explanation error, in reality my process is not even working.

And such more errors like this when I am disconnected, The whole point of me opening a VM was to keep my actual PC offline while server would run for me in the background.

I have also tried running my Script as a background process but it didn’t worked either. It still somehow didn’t have the permissions or something, not really sure why.

I also edited gpedit.msc and Edited necessary things such as “Session Time Limits” but its not revelant at all since my session is not turning off but rather function don’t work properly when RDP is not connected.

I have also trying running it as a scheduled task and windows service, the problem is still same, the script runs but its not working as expected, my website esentiially returns the errors.

Thanks for the helps, I hope we can find a solution for all.