I think the key is that as an employee, you are expected to act in the interest of the company in ways that are different from what you are expected to do as a contractor.
My perception and experience is that as a contractor, I'm supposed to do what you tell me to do. If you tell me to do something stupid, I'm supposed to tell you it's stupid, and to explain why, but if you say do it anyhow, well, that's my job. It has more to do with task-based work.
My perception is that as an employee you are expected more to act in the best interest of the company.
I personally have a hard time seeing the difference between the two, because I'm not omniscient, I am sometimes wrong, and if the boss has heard my arguments for why the way they asked me to do a thing is stupid and still wants me to do it that way, well, maybe the boss knows something I don't know, right? The company, by making them the boss, has said that the company thinks the boss knows more than I do, so maybe the right thing to do is to go along with it?
(I'm mostly talking of "the right way to do it" in the sense of "the most efficient or correct way to do it" - I think of ethical dilemmas in a different sort of way.)
As an employee, if you object to something your boss is really on board with, you can expect to be fired.
It is, in general, a career limiting move to tell anyone above you that what they're asking you to do is stupid. Maybe if you're a God-tier management consultant, you can propose changes and expect to have them implemented. As a regular employee or contractor schlub, no. If you want to keep your job, adopt their perspective.
(Illegal actions are another issue. While it's illegal in many jurisdictions to fire a whistleblower, in practice you're still risking your job to blow the whistle. Not that you shouldn't do it.)
My experience? unless you have like a bottom quintile boss, you can tell him/her almost anything, if you do it verbally, with the door closed.
I mean, in most cases, yeah, I'm technically more skilled than the boss... and the boss knows it, that's why I was hired. The fact that the boss hires people who are more technically skilled than they are means that the boss is good at their job.
Now, of course, there might be other issues related to the business or to other systems that I don't know about... the boss might not take my advice, but only a terrible boss won't listen to the advice of a technical individual contributor that they hired.
the places where I've seen people get in trouble for arguing with the boss is when they do it angrily and publicly, and when they don't get over it after the boss explains why it has to be another way.
>>> The company, by making them the boss, has said that the company thinks the boss knows more than I do, so maybe the right thing to do is to go along with it?
I don't assume that for one minute. I work in a job where there is literally nobody else in the company with my expertise.
So, I've been there, and... the thing that makes me chuckle is that a few years later, in part because I thought the boss was such an idiot, I started my own company with my own employees.
The funny thing was, I found myself, at times, getting into the same sort of arguments with my employee, only on the other side. There are... other factors in play, when you are looking at things from a organizational or business perspective.
And they face the same arguments with the managers above them, and so forth... "So, naturalists observe a flea..."