It's unlikely that he's been told that he's not allowed to poo.

What could have happened though, is that one time he was given a hurry-along, or maybe he was told he had to wait, and he has taken it on to mean that he's not allowed to poo? Definitely ask the teacher, they might not know what it is straight away, but if they know that that's what he believes, they can probably keep it in mind an get back to you.

Hope you sort it out though.