The problem goes away when I delete PM and all refs from the project.
It won't work if there is even one element referring to it, eg the last time I forgot to delete PlayMakerGUI from the hierarchy, although there was nothing in the project.
It's reproducible. If I make a new project and attach the script to my controller, it will work. As soon as I import PM, the game will fail to lock the cursor, disabling my script.