It's a bug with Gamemaker 2, unfortunately out of the dev's hands until the creators of the engine get it fixed. Pressing F1 in-game unlocks the cursor which makes it more bearable.