Yeah that happened to me today as well. An NPC trader disengaged from boarding and then as we pulled away from each other my ship flipped over and I was automatically dead. I happened twice in a row actually but the first time I got lucky and didn't flip over completely