Johnny767, I agree that if the CA is ill or incapacitated in some manner and not capable of safely flying the airplane, he loses command.
A CA who disconnects the autopilot and begins muttering "Tawakkalt ala Allah", loses command.
A CA who is thoroughly p*ssed about some work-related or labor issue, or is an absolute stickler about rules or authority, but is otherwise fully capable of safely flying the aircraft, I doubt he loses command.
Few dispute that the CA possessed the inherent authority to divert if he so chose, and provided he safely and competently executed the diversion, and the diversion itself placed no additional risk to the flight and passengers -- such as his choosing to divert to an airport where fuel minimums might come into play, or if the evicted purser had left the cabin with too few crew to legally continue -- then his rationale and judgment are for subsequent discussion between himself and management, and management will evaluate and decide.