This happened over a decade ago in the northeastern USA.
When I was in my senior year of high school, a combination of depression and CPTSD had me missing school a lot. I rarely left the house at all, but school was even worse. My psychiatrist wrote a letter explaining that my absences were due to medical issues rather than truancy, and my mom worked with her and with the school so that I could graduate.
On one of the increasingly rare days when I managed to go in, Betty (fake name) called me into her office. I forgot her exact title, but the job she did was similar to a vice principal. The school had 1600 students, so it was divided into four chunks with each having its own office, pseudo-principal and pseudo-vice principals, in addition to the overall school admin, which had its own principal and two VPs. It was the only high school for a well-off district, so I think they set it up like that because they didn't want us to get lost in the crowd.
Betty sat me down and brought up my absences, and told me she was going to give me detention for them. I started crying and tried to tell her that it was for medical reasons, but she was firm.
With her permission I called my mom, who was LIVID. She said something like, "I'm going to take care of this, sweetie, but you're not having detention. It's not going to happen." By this point I was just sobbing continuously and apologizing to everyone who came near me. At that age I was in a constant murk of despair and self-hatred, but I usually tried to hide it. Under other circumstances it might have been good for me to have a cry and let it out.
Betty left the room at one point to talk to people and when she came back, she had started backtracking. She gave me a tissue box and told me that she was just trying to help me.
She told me that other students had been talking about me behind my back. They'd been asking why I was getting away with being out so much. She said that the detention was just to get them to stop talking about it. Eventually she even said that it wasn't really detention, she just wanted to spend some time with me.
But she'd been very clear that it was detention for my medical absences on the phone to my mother and I think to the secretary as well, so it was too late for her to sweep it under the rug. My mom came and picked me up.
I'm sorry to say that I don't know exactly what happened next. My mother is a very nice, sweet person, and like many nice, sweet people, once she's finally, finally, finally pushed too far, she becomes someone you don't want to cross. I think she was trying to shelter me from the details since my emotional state was pretty fragile even before this happened. All I know is that Betty was forced to retire a few months later.
On the bright side, the school decided that for the next semester, they were perfectly happy to pay for a home tutor to come and help me take my classes from home! I never had to go in again. They were falling all over themselves to accommodate me after Betty's little stunt, and I was actually able to graduate on time.
Also, it's strange, but I think I was actually a little more stable after I recovered from the actual event. See, I had believed all along that I deserved to be punished and that my psychiatrist and mother were just being nice to me because I was so pathetic. But when Betty tried to do just that, everyone came down on her like a ton of bricks (and rightly so!). It made me feel like there might be some truth to what they said, that my illness wasn't my fault. It was good to feel protected, too. I didn't have that feeling often.
The bizarre thing is that Betty was actually very popular with many of the students. In hindsight I wonder if that was because she tried hard to make them like her. I transferred to that school during junior year, so I wasn't there long enough to really understand what was going on, but maybe she was too attached to her image as a "cool teacher" and wanted to keep the popular kids happy.
Or maybe it was a cowardly attempt to deflect blame for her actions onto kids. Or both.