No car dealer will ever sign a sales contract with a 17-year-old. As a minor, the contract would not be valid if the minor chose to have it overturned. That is a legal concept. Why would any doctor perform or prescribe drugs to change a child’s gender?
That child could change their mind and sue the doctor.