My issue was with Sea of Thieves where i would press the windows key to leave the game and go on over to my second monitor to change a song or something like that. What fixed it was I had to press the escape key and then my mouse could move to the other monitor. The windows key breaks the lock.
The game thinks that the mouse is still on the first monitor so it allows it to be dragged over to other screens.