Does an officer have a RIGHT to a command?
No
It takes due process to assign him to a different task, and put someone else in his job?
Yes but "due process" can be as simple as an officer commanding him issuing a letter to so do. There are actions that follow that, but "unplugging" someone from a job, or a command is actually quite simple.
COs of ships get relieved by a letter. There may or may not be disciplinary hearings depending on the nature of the perceived "offence." Back in the day, COMNAVSURFLANT had the CO relief letter stored as a standard for so all his yeoman had to do was fill in the name and date it. Two most common reasons was starting a deployment with CASREPs on equipment, or failing an OUTCHOP OPPE.
CASREP (casualty report) means a piece of equipment is at less than full capability C-2, operating with severe degradations C-3 or is inop C-4 OOUTCHOP is CHange of OPerational command as you go OUT of a command area – say from 6th fleet in the MED to 2nd Fleet in the Atlantic. OPPE is OPerational Propulsion Examination. The idea being that while on deployment, you will have had a captive audience onboard, been running the plant nearly continuously, had the opportunity to train your folks and had one or two repair availabilities in port where you can do repairs and get tech reps if needed.
Neither of those would typically lead to any charges, the exception being if there was a clear indication of lack of effort / derelection of duty. But if you just didn't make the passing grade, as the Donald would say "You're Fired." They would then drive a desk until their tour was due for rotation and with a blemish like that on their record, you know they'll get some real important high profile job like being XO or OPS of an arctic weather station, but with a career that was doomed.
At a lower level, a CO can relieve any of his officers of their duties. This can range from a simple case of essentially getting fired as a division officer onboard and being assigned as an assistant to the XO, or being relieved for cause. The problems are for the person who gets relieved for cause is that they are playing against the house with the deck stacked against them. They are immediately precluded from any of the spaces that they used to "own." They no longer have access to their people for the purpose of getting statements. They don't get to make copies of logs. And as soon as in port or transportation off the ship is available, they go to the Group Commander (the person in charge of a cruiser – destroyer group, or an amphibious force group for examples). The presumption by the Group Commander is that the CO, in whom he has placed his trust, has made a valid decision, and this is essentially a process by which another career is consigned to the dustbins of non-promotion. May even get orders to go be a department head at that arctic weather station!
Want to bet that the person getting the axe was always at fault and the CO wasn't just doing a pre-emptive strike to cover their ass and save their own career? I mean, would a CO actually duck responsibility like that and screw someone's career and life royally just to cover their own six?
That's a rhetorical question. I'm sure we all know the answer to that.
Going back to the CASREP issue, what do you think happened as ships were getting ready to deploy? Something breaks. It isn't immediately noticeable to an outside observer – gun mount loading mechanism broke a cog on a gear wheel – unlikely you'll be shooting in the first several days of deployment. If there would be a shootex, many ships have a second gun mount they could use. Want to bet whether a CO would risk not filing a CASREP with the idea that he can report it as happening a few days out of port, and likely have a part and tech rep waiting for their first port call on INCHOP, or, better to tell the truth and risk the very likely prospect of getting relieved for CASREP equipment just prior to deployment?
That's a rhetorical question. I'm sure we all know the answer to that.
Did most of them get away with it? Yep. But if they needed that gear they would have been screwed, all because a well intentioned program by the admiral made "CO survival" via appearances more important than knowing the actual conditions of readiness of his ships.