Just wanted to mention that I've been running into this too and it's quite frustrating.
Thanks to your post, though--specifically the part about running the EXE manually working fine--I realized the problem is likely with Galaxy rather than the game... I tried disabling the GOG Overlay (go to "Manage installation > Configure..." then the "Features" tab) and it _seems_ to have fixed it for me. Though, as you mention, the bug appears to be random, so maybe I will still eventually run into a crash. Fingers crossed!
Still, it does seem like the Galaxy Overlay is causing bugs in other games too--in Baldur's Gate 3, for instance, it caused the loading screen to show for _much_ longer than usual (like 3-5 minutes). Since I don't even use the overlay, I'm just going to disable it globally ("Settings > Game features > Overlay").
Post edited October 22, 2023 by varmaa