Well I know its not a glitch as I saw it happen in the perilous prize mission where the rich guys cargo vessel got destroyed in the fight but then showed up with the plasma leak animation. I know how to do it if the NPC gets killed, my question is how do I keep it from happening if they DON'T die
You don't, the trick is to place them on the exact same spot, and to name the first one with blank spaces (Like " "). If they survive, the new ship placed on the same spot with a name will appear, you can talk to them, and it will only look strange if the animations don't mesh with exactly the same positions. However, the example you cited, with plasma leaking, will work fine over another plasma leak or a ship without a default idle animation.
Had a feeling that's how it would work. Could I keep the name on the fighting version and leave the non combat one blank? With how I have this fight set up the player SHOULD win before its destroyed so it makes more sense to see the name at the beginning of the encounter instead of a blank
If they talk to the contact the button will read: "Talk to " if you name the appearing one blank. Also, I suggest, you set up a story dialog that says "All targets accounted for" at the least between the "kill all enemies" objective and the "speak with contact" objective. That way the contact will not appear before the enemy warp cores explode and destroy them anyways. (However, by that point they should be invulnerable anyways. Active speak with contacts have invulnerability, but not before or after their objective is in progress.)