Dear Ro,
You are clearly trying to
supportSupport
Support 500 the school in its expectations for your son - this is very important.
On the behavior management front, establishing an incentive system in which he is rewarded for successful classroom performance will help. Part of such a system should be some consequence for failure to behave appropriately, but don't let all the eggs remain in the basket of punishment.
Probably the key ingredient will be for the teacher to provide an amount of work that will occupy your son's attention, since he appears to do well when engaged in his work. It's too much to expect that a five-year old will finish his work and occupy himself without some assistance and guidance, though the teacher does not have to be engaging him on a one-to-one basis to do this. The additonal tasks do not have to be onerous - they can be quite enjoyable and fun.
My concern about punishing your child for this, is he may react by taking longer at his work and not completing it at all. He should be praised for doing so well, not punished. He is not really doing anything wrong, he just does not fit in the "box" and the teacher does not know what to do with him.
Anyway, that's my take on the situation from reading your post.
Take care.