I had it happen once with my pop-up. I failed to snap the catch. Popped right up. Luckly I was only a few feet from my campsite when it happened.
Just curious, I'm assuming this is a trailer you were transporting. Did the trailer get damaged? How fast were you going when it separated? And if you had any speed behind you, how did you handle stopping to get everything under control. Just curious.
Is it possible the coupler fell apart after you hitched up? You'd never know if something wiggled loose and literally unhitched when the right bump happened. Has your ball worn down so it does not fit any more?