Your son sounds a lot like my DD, in that they're both gifted rule followers. That combination is a toxic mix in a boring environment, because they're stressed about lack of stimulation, which motivates them to find other amusements, which then creates more stress due to their urge to conform. It's a catch-22, because they'll be miserable if they act out, and miserable if they don't. I've been their position, and the secret to my sanity, from elementary school all the way to the professional world, has been judicious rule-breaking.

I feel bad for the teacher here, because she's been set up for failure by the administration. My DD has had well-intentioned teachers in this same position. She's also had teachers who decided they weren't even going to try. Given the choice between subjecting her to continuing psychological damage and homeschooling, we took the second one.