Absolutely the case with my foster son, Kay. Brent had a terrible reputation for defiance with his teachers and school admistrators.
At home, he was anything but. Once he came to trust us, he was needy and even clingy. Putting him in a classroom was like flipping a switch. The presence of authority turned him immediately surly and hostile.
It took a lot of years for him to adjust after a life of neglect and abuse.
I don’t know how he did it, honesty. Kids are amazing in their resilience sometimes.