The Game Instance Class we have set in the Project Settings / Maps & Modes is a Blueprint inheriting from a C++ class which in turn inherits from UGameInstance (which might not be important here).
The Blueprint was moved at some point and a Redirector was created.
When trying to build or package the game and run, we would assert and crash on startup, with this message: “NewObject called with a nullptr class object”. The Game Instance Class was correctly set, the build was successful.
In the logs we saw that it had problems cooking that Redirector. We fixed the Redirector (right-click and “Fix up”) but got the same error again.
This time, it was because the Game Instance Class in the Project Settings / Maps & Modes was actually using the Redirector without our knowledge. And even thought the Redirector was fixed up and deleted, the Game Instance Class was not fixed and was reset to None. We had to set manually. Only then was the assert removed.
It feels like the build should fail if it fails to correctly process Redirectors. Or there is a check missing in the Redirector fix up process to also fix references to Redirectors in INI files.