In one novel I am currently reading a traitorous commander who is responsible for atrocities against the people he should protect and killing the remainder of the army he once belonged to was promoted to leader again after getting captured. As "reason" it is indicated that he is the last able commander in the army.
While I found other novels of the series quite entertaining, this is breaking the suspension of disbelief. I cannot think of any other action which is more damning that the person is unfit for command than betrayal. In fact, the usual course of action is that if the traitor is caught, his former superiors show profound displeasure with the actions.
Knowing that humans are capable of truly disturbing amounts of stupidity:
Was there ever a case that a traitorous military commander took command again for the side he betrayed and the superiors knew that he is a traitor?
Because "traitor" is often used as polemical term, I rule out some at least comprehensible edge cases. If the military commander acted because he reasonably feared that he was to be executed or ruined not because of misbehavior, but as a political sacrifice or because someone sees him as an inconvenient person, I don't count it. I also don't count it if the actions of the superiors can be reasonably counted as betrayal itself (Offering a defended city if the own life and belongings are spared). I also exclude whistleblowing, showing that something is profoundly wrong without personal gratification.
What I want is really a stab-in-the-back-and-turn-around-the-blade betrayal. Selling secrets or necessary equipment for money. Fall own units in the back or abandon them because it suits oneself. Trying to build an own empire without provocation. That kind of thing.