Ternie's scripted to bite it at that moment; first time I played this mission I was perplexed how she died since her ship was in good health. Reloaded and kept a very close eye on her, same thing. So I left her on the mothership, wa-la, she still disappeared but I didn't lose a ship this time

So now every time I come to this mission I make sure to leave her docked. Well, unless you have a spare ship you don't mind getting blown up.
Heretic's survival is kinda random, that's the annoying thing about allies and one of the few things that can mess up even a powerful team. I tried using the systems specialist Hero's hack skill on the greys (haha), it did freeze the target but they're scripted to disappear quickly so I didn't get to kill it. Had plenty of fun blowing them up in the subsequent rescue mission though.