Don't worry about it. Those teachers are idiots, and they got nuthin' on ya. Certainly don't develop a vendetta against them, if you're leaning that way. Just get on with your life and they'll leave you alone eventually.
Once when I was about ten, we had a creative writing class and the teacher said we could write anything, a story, a poem, a recipe, whatever. I asked if I could write a computer program and she said sure. Then when I handed in my work she had a proper go at me for it. She thought I was being intentionally awkward; she couldn't believe that a ten year old could write a computer program (this was a very simple Space Invaders style shooter using ASCII art and the BBC Micro dialect of BASIC that had been taught to school kids in the 80s, however this was the 90s she I guess she'd forgotten). My response to this telling off was to throw a major tantrum of unstoppable tears, and they called in my parents who explained that yes, it was possible (my dad started teaching me BASIC when I was 4 or 5) and I wasn't being intentionally awkward, just a little odd, and the teacher apologised.
In religious studies when I was about 14 or so, the teacher had us write about the argument for theism known as the watchmaker analogy. I wrote that with an infinite number of atoms and an infinite amount of time, a watch was bound to turn up sooner or later due to random rearrangements of atoms. She sent me to sit in the corner, for being "smart". I gained a modicum of credibility with the chav kids on that day; they seemed impressed that I'd done something that got me told off by a teacher. But when they asked what I'd done, and I tried to explain it to them, their brains couldn't cope with the complex ideas, bless 'em.
My experience is that the kids who are always cunts tend to get away with it most of the time, while the kids who are usually well behaved get it in the earhole if their homework is so much as a day late (which mine usually was).
My friends were generally the well behaved ones, but some of them also used to sneak out to smoke cigarettes and sometimes weed. One time when we were 16 or 17 the headmaster found them and told them he was cool with it, as they weren't causing mischief, just as long as they stayed out of sight of members of the public so the school wouldn't get a bad reputation. So, score one for the headmaster. He was pretty cool, I guess.