Game mode causing a crash if other object wasn't opened first

This happened already twice to my projects. First time was back in UE 4.something and I don’t remember what I did but I remember I solved it. However it happened now as well and I don’t know what to do.

I created a project that I’ve been working on for some time and suddenly, when I tried opening the project one day, it started crashing and didn’t want to be opened. I deleted config files to start with blank level and it loaded. I realized then that the cause of the crashes was a game mode object. Whenever I was trying to interact either with game mode itself or any object that is referencing it, unreal was crashing. And what’s strange is that the game mode doesn’t work until I open any asset not referencing it (for example save game object) and compile it. After this, the game mode starts working just fine until I reopen unreal.

This is not only annoying to work with (due to this I can’t load map with the game mode on default or unreal won’t open) but I’m also afraid it might cause the final build to crash.

Finally, I’ve seen a post from a while ago about similar issue. It said it has something to do with structs and assigning default values to them. It also said that setting all the default values for structs to false, zero, null, etc. solves the issue. However, I did that and the game mode still causes the crash. And also the game mode doesn’t use any of these structs so I have no idea how it could possibly be connected.

Does anyone have any idea for how to fix this issue?