My DS was older than yours by the time his PANDAS was such that it really made school an issue, but I can certainly relate to what you're currently experiencing as my DS first got a "regular OCD" diagnosis at the age of 6, just a few months into his first grade year.
Do you have a therapist involved in your DS's overall treatment plan at this point? Obviously, we had one because we couldn't get anyone to sign on to PANDAS at the time, let alone treat it, but he was a good resource for in-school and at-home strategies for addressing our DS's OCD (mostly perfectionism, which led to either over-erasing or avoiding writing down anything at all, for fear he would get it "wrong" somehow) and attentiveness issues. Mostly, at the time, we made appointments with DS's teacher(s) and the school psychologist (maybe social worker, too, if there is one), gave them some material about his behaviors and what they might see (you could add "during a flare"), and any suggestions we might have for accommodating him reasonably in the standard classroom but not at the expense or disruption of the other students. It appears your teacher is doing that with her timer tactic, though you may be right that it might increase his anxiety and, ultimately, he may still fail to "cooperate" because that OCD fear of doing something wrong will typically outweigh the fear of displeasing the teacher, in our experience, anyway.
It would probably be helpful to get the school psychologist and/or social worker involved, if possible, because they can help the teacher with appropriate strategies in the classroom, too; yours is likely not the first kid who needs some accommodations that they've come across, with or without a PANDAS diagnosis. They might wind up suggesting a 504 Plan which would be something to consider.
I would also suggest the book "Students with OCD: A Handbook for School Personnel," by Gail B. Adams, ED.D. I bought copies for myself and for my DS's administrator and psychologist when it first came out. In remembering that the school is not equipped to "treat" PANDAS or OCD, but that their goal is to give your kid the best education possible, before, during and after illness or a flare, giving them tools to meet the primary behavior set in the school setting, IMHO, is really all that we can ask of these folks. The ideas and suggested accommodations in this book are really, really helpful, in our experience. And because they come from a "third party," we didn't get a lot of pushback as though we were advocating for something that was inappropriately lenient or anything.
In the end, it might be that your DS needs to have auditory assessments, rather than written ones, during a flare so that he's not required to write things down on paper for a period. He might need some alternative assignments, depending on what's at hand; for instance, my DS HATED "coloring" as his small motor skills were never up to par when he was sick and that messed with his perfectionism (staying within lines), plus, he quite honestly thought that the very act of "coloring" was a waste of his time; some kids love it, he hated it. So the teacher came up with some other options for him that were more "spatial" and less triggering for him. We were also able to get them to eliminate some of the "busy work" -- tasks and/or assignments of nominal value that were more "crowd control" and "quiet time" undertakings than they were teaching of basic concepts. So, in other words, if he could demonstrate his mastery of the math by doing 5 problems instead of 10 (many of which were repetitious), then he was awarded grading in accordance with the reduced quantity of problems he was assigned.
Good luck to you!