This shows the necessity of reasonable defaults. Not a pilot, but somehow I think the default setting for ALT should NOT be 0.
A good safety check here would be to not record an altitude if the plane’s airspeed is moving less than some value (or perhaps better, if AoA is above the critical limit as the wing is stalled).