Getting the same result in different ways can legal or not:
Obvious example:
Saving a x amount of money from taxes using a legal loophole is legal.
An exact equal company trying to save the exact same amount of money by lying to is doing something illegal.
Far less obvious example:
Around here (and possibly elsewhere, I don't know) if you make a drink from wine and spirits you have to pour the spirit first because increasing the strength of wine is illegal, but decreasing the strengt of spirits are OK.
I thought it was an old joke, but someone I have reason to believe said it was true and you could get in trouble for it.
Consider the example of engineers getting the details of tax compliance in a payroll system wrong because their boss provided the wrong instructions. To my mind, they should not be at fault for this unless they demonstrably knew what they had been asked to do was illegal.
I'm not a lawyer. I expect if I'm being asked to do something, it's been vetted by our corporate legal team. I should not be expected to know every aspect of criminal and civil law to protect myself from my employer.
That's you. I've quit jobs before because I was not willing to do something that went against my principles. I think it's pretty simple to ask yourself how you'd feel if you were on the opposite end of some questionable corporate action and later found out that you had been deceived or exploited.
Which is exactly why this is such a horrible idea.
"I have been only following orders" had stopped being a valid defense quite a long time ago.
And I'm not misreading your comment on purpose, trust me I had to read it 4 times just to make sure I wasn't crazy and I was actually reading what I thought I was: someone advocating that bottom of the food chain employees be criminally liable for code they write.
You are making an us-vs-them argument, to be sure. Your "us" is consumers and your "them" are employees, rather than corporate executives that make the decisions.
I'm not a lawyer. I expect if I'm being asked to do something, it's been vetted by our corporate legal team. I should not be expected to know every aspect of criminal and civil law to protect myself from my employer.
What you are suggesting is absurd, but fortunately, I think most would agree with me on that.