I would always, always, always allow kids to go to the bathroom when they ask to go. It is not fun to deal with accidents on the floor, mats etc. So hard to get the stains and the smell out!
A lot of the time accidents happen when the kids don’t ask to go to the bathroom because they usually think they are not allowed. Even if you have a gymnast who takes habitual bathroom breaks, if the other kids hear you saying no to them when they ask, it can make them think they are not allowed and lead to other kids having an accident.
If a kid is going a lot they may be suffering from a UTI, so it may just be worth mentioning to the parents. Or they may be going through an issue, like they feel like they can’t do the work, so they avoid it. Refusing to allow them to go to the bathroom doesn’t solve the issue.
I remember being a primary school aged kid myself and asking to go to the bathroom in order to get out of class. It wasn’t an avoidance tactic but all the pent up energy in my little body needed to be released. A little walk to the bathroom and back helped emmensly and I could focus a lot better after that. As adults if we feel to restless to sit, we can choose to get up and walk around and do what we need to reign in our focus, kids have limited options.
If you think kids are doing it to get out of something unpleasant it’s pretty easy to deal with too. Example “Susie, you just missed the 1 minute split hold while yiu were in the bathroom, we’ll quickly get it done now while the rest of the class goes to trampoline”. Etc.