The reason? What he wanted to say contained some critical comments about the school's response to his experience of being bullied.
All leaving pupils had been invited to give a brief speech to mark the end of their time at primary school before moving on to secondary after the holidays. This, in itself, is to be commended as it suggests a willingness to take the voices of pupils seriously.
However, when this particular pupil showed his text to a teacher, he was told that the critical material would have to be removed, otherwise he could not take part in the service. Most of his statement was positive and contained warm tributes to teachers who had inspired him and enthusiastic comments about projects and school trips. The offending part of the speech consisted of four short sentences: "I have good memories and bad memories.
I will always remember my best friend and being bullied. I was bullied for three years. The staff that I told didn't do anything to help me."
I find it difficult to understand what the school hoped to achieve by banning this statement. As it turned out, the ban ensured much wider publicity than would have been the case had there been no intervention.
No comments from the school staff were reported, but the decision was clearly not the whim of one person as it was endorsed by a spokesman for the local authority who said: "The school assembly held in church was a celebration of success and achievement and, as such, the children were encouraged to focus on their own success and achievements throughout the school year."
In other words, only good news was welcome. We are only too familiar with the techniques of news management as practised by politicians and others occupying positions of power.
One hopes for better in the world of education which is supposed to be concerned with truth. But we are all tainted by the influence of spin doctors who seek to bury bad news and present an upbeat perspective on every story, excluding any unwelcome facts or opinions.
An important question to be asked about this episode is "what did the pupil learn from his experience?" Among other things, he learnt that some adults say that they want you to be honest but are only prepared to listen if you tell them what they want to hear. More positively, he learnt that sometimes it's important to stick to your principles even if there is a price to pay.
He decided, with the support of his parents, that he was not prepared to submit to censorship, despite the fact that he was thereby barred from taking part in the rite of passage in which all his fellow-pupils participated. It was a brave act and I commend him for it.
The story has a significance that extends beyond itself. It is symptomatic of the professional culture of compliance and conformity which continues to dominate Scottish education.
Just as pupils who dare to be different are seen to be a threat to the "integrity" of the system, so teachers who dissent from policy orthodoxies are regarded as dangerous and may find themselves subject to formal and informal sanctions.
They might take courage from the actions of a primary 7 pupil.
Walter Humes is director of educational research at Aberdeen University.