Just a theoretical possibility, from someone with no NG experience..
During the excursion, the fuselage broke. The flap lever may have mechanical linkage to the control system in the wheel well. The linkage may have been pulled to the retracted position during the fuselage fracture. I'm sure the hyd lines that service the NLG extension/retraction/NWS would have been severed, but thats served by system A. System B therefore remaining intact to retract the flaps by either an idling engine or windmilling core rotor of the no2 engine.
Shoot me, its just a theory!