I have heard of this problem so many times and I am convinced it some Laziness, they get engrossed in what they are doing and forget, if he has just been to the Bathroom, and you leave him for a few mins he is going a lot, does he drink a lot in the evening, I assume it is evening as you say he doesnt do it at school,perhaps let him drink what he wants during the day and cut back in the evening.I agree this doesnt warrant punishment,it is probably merely a moment in time adjustment as he gets older, for now Mop up and dont worry.