Off the top of my head, I reckon you accidentally pressed the button to launch your ship and the ship wasn't actually docked when you thought it was!
(Indeed an overly sensitive button could likely easily launch your ship, when you didn't seemingly press the launch button yourself.)
Once you click launch, intentionally or otherwise, the game only gives you five minutes to clear the pad before it decides that you're loitering and committing an offence, upon the timer counting down, it first fines you then very quickly starts shooting at you and destroys your ship, if you haven't cleared the station area!
IF you're playing on a system with is automatically recording your actions in the background, such as a PS4* or Xbox One, when something weird, cool or unexpected happens, it's a very good idea to press the capture button to see more clearly yourself and to show us all what happened!
Indeed I always find it very annoying how easy it is to accidentally launch your ship when you didn't mean to, while when you do click launch, the game doesn't let you redock until you clear the launch area and make a new approach and landing request!
(*The default capture time on PlayStation is the last 15 minutes, while you can increase or decrease the capture time, increasing or decreasing the storage space necessary to save a video...
Once a video is saved, you can edit it and take clips out of it and any other captured footage...
On PC, you likely need a dedicated capture card or a programme like Frapps



.)
Anyway, long story short, going AFK is a bad idea in any game (especially so in Elite when deaths cost us so much, often unnecessary, while logging out and back in when you return is much safer and highly recommended!
If I'm right, I guess you have to chalk this up to experience, assuming you can't prove that it was caused by a bug, which I don't think it was, while as said, footage of the incident is very useful, if and when you can get it!


.
Edit - Also I was just reading the post above mine and indeed as I said, while capturing footage is much easier on console as it's a dedicated feature of the eighth generation of consoles on, that journal that Lhorndra mentioned is something extra that you can only do in the PC version of the game




...