T.F.
I've been in the classroom 17 years as a substitute, mostly with this age group.
There are specific bathroom times when we encourage the children to go at that time. Morning break, lunch, before/after recess and after specials such as music art PE. It's important they learn to be in the class during instructional time.
We're trying to teach them about the routine and structure in the classroom.
Many times, if you let 1 go potty you have about 5+ more who suddenly need to go to and this disrupts the class.
Of course I allow children to go and I know which ones are asking to go in order to get out of the classroom with a buddy.
I would communicate with my child to try to adhere to the bathroom schedules. Also, most children exaggerate and you may not be getting the whole truth from your child. I would not talk to the teacher unless this routinely happens.
We still have some children that age who struggle to hold it. I never want to not allow a child to go and then they have an accident in clsss which is humiliating to them.
My way is to allow a child to go but remind them about the specific times they should go. When others suddenly have to go because 1 is going, I judge that based on history with each child and who is known for using bathroom requests to get out of the classroom.