Do you have the AFK camera enabled? If so, try disabling it. Have you tried switching between windowed, full-screen, and borderless windowed? Perhaps disabling full-screen optimization in Windows for this game would help. You should also poke around Event Viewer and see if you can find any errors that coincide with the restart happening. Finally, if you've updated Windows since the issue started occurring, try rolling back.