I thought it would be hard to make an example project because:
1)i don't really know the cause
2)the error appears randomly
but making an example project is probably literally impossible because:
3)i was trying to make an example starting from a scene that was giving me the error, i made a copy without any changes but guess what the copy doesn't give me the error while the original around 50% of the times gives me the error.
4)i made another copy without any changes from the original and this one gives me the error but again the first copy doesn't give me the error.
I opened the .tscn files with a text editor, copy1 and 2 are exactly the same while the original scene has a different ext_resources order.
I tried with another scene that gave me error and i was able to make a minimal copy scene that sometimes (1 over 8 times more or less) gives me error, but if i make a new project for the error and copy the scenes i don't get the error.
The window is the default 1024x600 border window, it's like if godot doesn't read the settings when the error appears, and maybe that's exactly the reason, after all the autoload class are part of the settings right? If godot doesn't make GLOBALS a singleton the other classes can't reach it.
If you really want to try(but it's probably just a waste of time) the minimal scene i made is like this, you need 2 scenes with those gdscript lines:
in the project settings change the windows settings and put GLOBALS in the autoload and then run the NODE scene many times until the error appears(but it probably won't appear).
At this point my bet is either on something that makes godot skip the project settings(that would explain the window and the error but not why this happens with some scenes and others not) or on something that messes with the initialization/call/whatever order(that would explain the error and maybe why it happens on some scenes and not others and why it doesn't happen in simple projects, but it wouldn't explain the window settings) or maybe both.