Thanks for posting your question in the Microsoft Q&A forum.
I have two suggestions for you, and I hope they help resolve your issue:
Use a Screen Capture Utility: Instead of relying on OBS Studio installed on the server, you can use a screen capture utility that doesn't require an active session. There are several third-party screen recording tools available that allow you to record the screen remotely without being connected via RDP. Some options include Bandicam, Camtasia, and ScreenFlow.
Configure OBS Studio to Run as a Service: You can configure OBS Studio to run as a service on the Windows Server. This way, the recording process will continue even if you disconnect from the server. You may need to use third-party utilities or scripts to set up OBS Studio as a service.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful