When selecting a region, I sometimes move the mouse cursor onto another screen by moving past the screen's edge. This is especially common when trying to capture a border or corner of the screen.
The pointer-constraints protocol is usable to prevent this from happening: once the mouse button is pressed, prevent the mouse from moving onto other screens, since doing so produces bogus values.