Hello,
When you disconnect from a Remote Desktop, any interactive programs will close. If the remote side functions more like a server, then your client will disconnect when the remote side terminates.
If the Answer is helpful, please click "Accept Answer" and upvote it.