I agree with parents & legal guardians having the legal right to choose to remove their consenting child from religious education, sex education and assemblies with any worship element that everyone else has to attend.
But if the child disagrees and wants to attend, the child's decision should be accepted by the school teachers or local authority.
Plus kept confidential, if that is the child's request.
But there should be no parental right to opt out their child for any classes that they object to connected with: science, pshe, law, music, dance or art.
In many of the schools I went to a small number of zealots present within the teaching staff/board of governors/parent rep groups were openly seeking to impose their own favourite dogmas or religious traditions aiming to indoctrinate malleable children to fit their mould.
Usually aiming to ensure that the children regularly participate in communal religious worship, fear the consequences of not complying with the 10 commandments, automatically take overbearing militant atheist or vocal anti-theist positions whilst on school premises.
So many JWs, fundamentalists & ultra-traditionalists of all different religious backgrounds with obvious separatist religious agendas are in the habit of insisting upon forcing their children/other peoples out of educational classes.
Trying to prevent the child from knowing the law of the land or experiencing national mainstream public opinion during their youth.
So that the child will not see nor hear the alternatives to ancient family tradition and parental favourite religious teachings verbally challenged or directly opposed by school staff & specialist professionals.