A fifth-grader getting punished for reading in school is unfortunately a sign of just how poor the education system is, and how inflexibly stupid (or stupidly inflexible) most teachers are. I say this, by the way, as a teacher. I can't stand 90% of the people in my profession.

There is no reason for your daughter to accept any of this. Okay, forgetting to bring a jar to school - fine, that's a mistake, and if other kids were punished for it too, then no issue. But your other examples are clearly times where she is attempting to avoid boredom, the alternative to which would probably be constant acting out. I'd remind the teacher of THAT for a start. In any case, the fault lies with the system that produces the boredom in the first place. For gifted kids, having "perfect behavior" generally means shutting up and not learning, which I don't think any of us here would encourage.