Doubt if this has anything to do with sensory issues as we see this issue on the forum all the time (check some of the earlier posts). Besides margypops questions which are good. I also wonder if this also happens on the weekend. And roughly what time frame does this happen during the day. I assume that he is in kindergarten and these only happen at school?
I am not certain but I have no doubt the sensory expert will know all as that is what appears to be the cause of everything on this forum recently ..My opinion is that he is possibly upset by something, is this a new school, has he a new sibling .and find out if the teachers are giving the children enough time and telling them to use the bathroom..good luck.