Hi Peter,
I’ve tried this in my project using 4.1.1 and used the projectboost_console.exe to get the print statement to show as well and this is working fine for me when pressing the escape key to exit the game.
I double checked with Bramwell as admittedly i am a little rusty with godot in case ui_cancel was a editor only input action but as he corrrected me it is a native input event so it should work. It would be a pretty big bug in the engine if 4.1.2 was at fault here.
I wonder if when you run the projectboost_console.exe you get any other messages when you press escape in the game window or any other messages in the console that might give a clue as to why this is not working for you.
If you have any more information on this please do let me know or we can take a closer look at your project by zipping the project folder and uploading it by the following link and letting me know here that it has been uploaded.
Thanks
https://gdev.tv/projectupload