Happened to a friend of mine! He was the captain of a Los Angles Class Sub and while he was asleep whomever was in command at the time ran into a Japanese ship due to the venturi effect (basically the sub got sucked into the ship as the ship passed over it) and my friend was relieved of command and shortly thereafter left the Navy. Keep in mind before he was a captain of the vessel he was the chief tactician for an admiral at the pentagon. He had a great reputation and knew the right people but in the end it just didn't matter. The commander is where the buck stops.
Ouch! So you are telling us the modern US Navy still clings to this outdated, rigid "the captain is responsible for everything (i.e. every thing)" 300 year-old naval "tradition"?
This would be rather stupid, considering the costs the taxpayer invested into the training and education of your friend from an economical point of view (from a human point of view it's awful: so you have to be an a**hole to make sure the crew will do its job 100% right but in return will hate and despise you - unless you are a born and natural leader?).
At least, TOS suggests progress in the far future: In "The Doomsday-Machine" Kirk tries to persuade Matt Decker to return to the Enterprise
- "We need your experience!"