sounds like a frustrating issue! A few things to try:
Check Game Settings: Look for a “Confine Cursor” or “Lock Mouse” option in the game’s settings to prevent the cursor from leaving the screen.
Update Drivers: Ensure your mouse and graphics drivers are updated.
Disable Background Apps: Background apps or overlays (e.g., Discord, Steam) might be interfering. Disable them temporarily to test.
Full-Screen Mode: Switch the game to full-screen instead of windowed or borderless.