If you accidentally toggle it on, the fix is luckily very simple. Click the # key on your keyboard to instantly toggle UI ...
You may have noticed that the Mouse cursor does not lock to the game window in Windows 11/10 at times. There are various instances of this issue. Sometimes, the mouse fails to lock in specific games ...