George Marshall who was, among other things, Chief of Staff of the Army during WWII was lauded for his policy of yanking commanding generals if they didn't adapt to new positions quickly. But he lessened the stigma of being relieved by transferring them to other commands, still at flag rank. Several commanders early in '42 were removed from commanding infantry divisions, but were given commands of units in combat support or material support or training where they went on to deliver stellar service. So it was like finding the right guy (and it definitely was a guy back in those days) for the right job.
This is in contrast to continental armies with aristocratic baggage who found it difficult to fire flag grade commanders (looking at you, monty.)
But the political risk to his own career was enormous and the only way he got away with it was with the full support of FDR and his reputation earned partially as Pershing's Chief of Staff in WWI.
He is also the only person in the US Army to be considered for the rank of Field Marshall, mostly because FDR thought it would be funny to have Field Marshal Marshall.
Which is to say... you might be able to cheat the Peter Principal, but the amount of effort seems great and you would have to work very hard to sooth the egos of those demoted or reframe the demotion as a lateral xfer.