Hello there,
To work around this issue, you can enable the Configure keep-alive connection interval policy in the Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections group policy folder. If you enable this policy, you must enter a keep-alive interval. The keep-alive interval determines how often, in minutes, the server checks the session state.
Please check on the remote PC if there is group policy to set the RDP transport protocols as "Use only TCP". If so, please change it to "Use both UDP and TCP".
Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections
Here are some links to help you out in this. https://learn.microsoft.com/en-us/troubleshoot/windows-server/remote/troubleshoot-remote-desktop-disconnected-errors
https://learn.microsoft.com/en-us/answers/questions/230783/rdp-constantly-reconnecting.html
I hope this information helps. If you have any questions please let me know and I will be glad to help you out.
----------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--