I see the term “demoted” but I don’t see anything that actually says he was reduced in rank. He was relieved of command and reassigned to a staff job. As I think about it I don’t think I’ve ever heard of an officer reduced in rank, just offered the choice to resign. He’s got 20 in so he might as well hang it up - he will never be a 4-striper of have any other command.
A court-martial cannot reduce the “permanent” grade of a commissioned officer, key word permanent. This officer may have been holding a temporary promotion and a temporary promotion can be vacated, and that could be done through administrative means. I’m guessing that this is what happened.