Hi,
Thank you for posting in Q&A! In regards to your issue,
The Problem Cause in microsoft official document says:
"This behavior occurs if a policy setting enforces a time limit for idle Remote Desktop sessions. If an active session has not received user input for the time that is specified in the policy setting, the session disconnects. Pressing a key closes the warning message that you receive two minutes before you are disconnected. However, this action does not reset the idle timer. To reset the idle timer and keep the session active, you must provide user input other than the keystroke that closes the warning message."
Solution:
The user must provide input other than the keystroke for "OK" that closes the warning message.
Refer to the Active session limit and Idle session limit sections in the following Microsoft Technet article for more information:
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc754272(v=ws.11)?redirectedfrom=MSDN
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.