I don't know why, but there is a utility that allows you to lock the mouse cursor inside a certain zone or application. This utility is called Lock Cursor Tools.
After launching it in the settings, you can select two types of cursor lock: inside the selected zone or inside any application.
In the first case, you need to select an area on the screen, beyond which the cursor will not be allowed to leave. And in the second, you can choose any application. When it is active on the monitor, the cursor will not be able to leave the area of the application window.
Lock Cursor Tools can work with multiple monitors, so there should be no problems with locking on the second or third screen.
After setting in the context menu, you need to select the Lock item and the cursor will immediately be locked inside the selected zone.
To get out of the trap, you need to press the key combination