Mission spawned incoming enemies don't scan you, they just attack - it's their reason for existing. Random pirates always scan and leave muttering inane chat about children going hungry if you're not carrying anything.
That said, you're right that surviving an NPC attack should be quite doable. If this was indeed a mission thing (and not a player) then it's possible that the OP and their friend simply took a high ranking mission and got in over their heads.
THIS.
From OP's post about being so close to a mission reward this wasn't just a cargo run. If you're on a mission and you're way underranked, if you get interdicted you'll die. FAST. It's happened to me. Dead in five seconds. Don't. Fly. Without. Rebuy.