Core/GameObjects: Fix crash if GameObject cannot be created

Close #13798