If you have three or more displays (including the built-in display) and have experienced cursor movement issues, avoid setting the main display at either end. This can cause the cursor to get stuck on one of the displays due to a macOS issue.
To fix this, go to System Settings > Displays > Arrangement and move the menu bar to the middle display or another display that works for you.
This is a longstanding macOS issue. Although we notified Apple about it in 2020, we never received a response, and the issue remains unresolved.
I can't change my display arrangement at the moment. Is there another workaround?
Selecting a particular display should help resolve the issue if you cannot change the arrangement or don't have physical access to your Mac.