There is an important difference in the UNCRC between rights to protection and rights to participation.
Rights to participation are about our ability to make decisions, such as voting or making decisions about medical treatment. For example, the law in Scotland says that under 16s can consent to medical treatment if a doctor believes they understand what the treatment or procedure means.
However, rights to protection exist to protect children from harm. Because punishing children, and treating them as adults when they commit crimes, can be harmful, Article 37 and Article 40 of the UNCRC are both protection rights.
That means that every child should enjoy them until they are 18.
UNCRC Article 37
I have the right not to be punished in a cruel or hurtful way
UNCRC Article 40