Happened to me once soon after my ppl. It's even scarier when you're alone sad the only lighting on the ground is a papi (was unable to switch on the pilot operated lights due to the radio being off) and having to wedge my torch between my legs!
The best part was being told by the school (OBA) the aircraft was fine only for it to have the exact same problem a few days later with another pilot. Happy days.
Luckily there was some light from the built up areas as it happened around ten miles north of the field but I would not want it to happen on a moonless night in the middle of nowhere.