There are other smuggling missions which do not fail if the mule is being scanned. Feel free to pick up those instead. You will recognize them by the fact that they are not called Shadow deliveries. These missions do not have the fail condition on ship scan.
If anything, any smuggling mission should have an ADDITIONAL penalty: THE POLICE COMING AFTER YOU!
I can't believe pirates know how to ask for cargo and shoot if you don't drop it, but when the authority ships scan you, they do not demand to drop your cargo. They just fine you an go away. You could be carrying enough nerve agents to take out the whole of Alioth, "naahh, this guy will learn his lesson if we fine him 6512 credits!"
The fact that Robigo or other outlying systems mostly display the mission-failed-on-ship-scan mission variety is IMHO a flaw in the mission system. If they would allow other types of missions to appear, now only would it make more sense lore-wise, but would solve the problem you mention and somewhat subdue the mission stacking abuse as well.