Managed to get a few logs by messing with Rosetta:
array_set :: variable Index [2] out of range [1]", script : "gml_Script_lua_state_exec", message : "array_set :: variable Index [2] out of range [1]" }
{ line : 0, stacktrace : [ "gml_Script_lua_state_exec (line 18)","gml_Script_lua_call (line 8)","gml_Script_sc_menu_draw (line 194)"]
array_set :: variable Index [19] out of range [19]", script : "gml_Script_lua_state_exec", message : "array_set :: variable Index [19] out of range [19]" }
{ line : 0, stacktrace : [ "gml_Script_lua_state_exec (line 18)","gml_Script_lua_call (line 8)","gml_Object_co_mods_KeyPress_1 (line 12)" ]
array_set :: variable Index [19] out of range [5]", line : 0, stacktrace : [ "gml_Script_lua_state_exec (line 18)","gml_Script_lua_call (line 8)","gml_Object_ob_player_Draw_0 (line 71)" ]
They all trace back to a lua_call, the way it's being called hasn't changed in forever so I wonder if the state being passed in is getting read wrong somewhere due to YYC compilation? The state always comes from lua_current, however the lua_current references do get stored in a ds_map which is sometimes used to pass the state, I tried changing to structs but get the same crashes, and logging the state values all seems correct.
I guess only thing is how the scripts have got converted to CPP with YYC? I can send over the generated lua_state_exec and lua_call .cpp files if that would be helpful?
EDIT: Looks like this does happen on Windows too using YYC, I just haven't seen it reported as the Windows build is exported with VM only so hasn't come up before! I tried building Windows YYC just not and get all the same crashes so seems like it isn't specific to MacOS, just YYC in general.