Three possible options, none of which have anything to do with the firmware (the doors are mechanically actuated by pulling on the handles).
1) The latch failed
2) You didn't fully close the door
3) Aliens
It's hard to admit to ourselves, but human error is the most likely cause here. I'm not accusing you of being an idiot — everybody knows how to close a door, after all — but you also know that Model S doors require a bit of force to fully close. You know you closed the door fully, or at least you think you did — our brains are great at filling in the details of stuff we weren't really paying attention to with what fits our preconceived expectations (this is what makes eyewitness testimony so unreliable), and something as simple, repetitive, and non-thinking as closing the door gets filled in every time it happens as expected.
I'd not worry unless you're noticing parts of the latch that seem worn or damaged, unnatural movement of the door when opening or closing, looseness when closed, or (obviously) it happens again.
Or it was aliens.