After some new tests - crashes because of no enough RAM (game uses around 2GB when crashes - with only 5 lines of code).
Viewing post in [Fixed in GMS2.3.1+] Runner randomly exits with non-zero status
I was gonna suggest memory issues too. I wonder if increasing the RAM would fix this (or at least extend the running time before the crash). My PC is on a limited motherboard platform, so upgrading means I have to throw 2 sticks away - heck I'd be fine with doing this if that fixes the problem.
It's even more apparent when doing things like drawing inventory items in the form of grids, since you have to constantly nest for loops together.
Here it is: https://gmclan.org/up23_18_gms_23_GMLIVE_crash.html (with GMLIVE cut, need to be re-added).
To crash, I just need to run it and wait about 60-120 seconds (you can watch memory usage in Task Manager, for me it crashes around 1.5 GB used).
This is how memory usage looks on my side, the moment of crash is easily visible: https://i.imgur.com/PP5RVF6.png
Edit: here is a chart from GM debugger for above example: