Casting to game instance always fails when packaging the game

This bug still exists in 4.26, thanks so much.