If I move my cursor while in any GUI, including the "escape" menu, my inventory, as well as chat, if I exit the gui while my cursor is in motion, my camera jumps, pointing my head and crosshairs in a different direction. It seems that moving my cursor to the right while exiting will pan my gaze to the left and vice versa. Whether [the cursor is moving when I exit the gui] seems to be the only factor determining whether my camera jumps, regardless of how many times I start and stop moving the cursor while the gui is open.
I am experiencing this behavior in 1.16.5.
If I move my cursor while in any GUI, including the "escape" menu, my inventory, as well as chat, if I exit the gui while my cursor is in motion, my camera jumps, pointing my head and crosshairs in a different direction. It seems that moving my cursor to the right while exiting will pan my gaze to the left and vice versa. Whether [the cursor is moving when I exit the gui] seems to be the only factor determining whether my camera jumps, regardless of how many times I start and stop moving the cursor while the gui is open.