Yeah this is really annoying for me as well. I found that if you go into the system tray and click on ‘power management’ and then tick the box for ‘manually block sleep and screen locking’ it’ll solve the issue. Unfortunately it means that your display won’t go dark when the system is idle, so I have to remember to untick that box after I’m done gaming in order to keep that behaviour.
I made an extremely half-hearted attempt at it at some point, but couldn’t immediately find any cli commands to toggle that option so I gave up pretty quickly.