You can configure Remote Desktop Services (formerly known as Terminal Services) to disconnect and/or end sessions based on timings of your choice. A Microsoft forum entry describes the various settings and options available.
Black screen with cursor when RDP to Windows 11
A few users have encountered an issue when they login - for the second time - to their Windows 11 PC remotely (using...