I have this same problem, and it is definitely nothing to do with pirates. The first time it happened, my ship didn't appear in the 'I' menu, but I wasn't paid any insurance. I went back to the sector where I left it (before getting 'connection to server lost', in singleplayer) and it wasn't there either. I decided to look around the nearby sectors, and when I came back it magically appeared again, but it didn't appear in the 'I' menu until I boarded it.
The second time it happened (a few minutes ago), I repeated all this warping around and relogging, but I haven't found it again yet :'(
I posted a bug report with the logfile from the 'connection to server lost' BS, but I have no idea how to replicate it so it seems it won't get fixed until we can find out what is causing this... :(
I guess I'll just play multiplayer for now.