Baby Gard’s death is state-endorsed eugenics

Baby Gard’s death in my view amounts to state-endorsed eugenics.
The European Convention on Human Rights provides that the death penalty can be legal, providing it is made by the order of a court. In my view the UK courts have enacted this right by ordering the killing of Baby Gard without his parents’ consent.
My living will says that I wish to continue my EEG research should I ever be dependent on life support like Baby Gard was. It says I should stay on it until it is possible for me to be a candidate for cryonics.
Why should the parents of Baby Gard not have had the same right to decide his future, such as for him to take part in an experimental treatment which even if it was ineffective, would have helped advance science in a small way like I want to happen with me in the same situation?
The judicial killers of Baby Gard would likely have ruled that an adult who wanted to end their life by choice should not be assisted by doctors or anyone else. So why did the courts assist the killing of Baby Gard against his parents’ wishes?