I would go to the doctor's appointment and explain the issue to them. In an ideal world, they would understand transgender healthcare and either refuse to work with you all together, or only if they can treat you as a trans patient. Since your grandfather probably will not allow you to pursue any kind of HRT or blockers, the goal would be for them to refuse to treat you. Consider pulling up the WPATH website and having the Standards of Care PDF saved in your email, and offer to forward it to the doctor you see if they need reference material on how transgender patients should be treated.
In the mean time, call Child Protective Services and let them know about your situation. At the very least, they should stop in to investigate and may assign you a case worker that you could contact directly. At most, they may remove you from your grandfather's custody.
I would do this ASAP, and I would mention to the doctor when you see them that you have reported your grandfather to Child Protective Services. Most doctors will not want to be seen as complicit in any kind of child abuse, so this should encourage them toward the "I'm not treating this kid" route.
I would do your very best to stay calm and well reasoned with everyone you speak to. Do not get upset or overreact if you hit a roadblock. You will not be taken as seriously if you do.
Are there other relatives that you could stay with? A friend's family maybe? I would also consider reaching out to PFLAG in your area and seeing what advice they have. They may know LGBTQ-friendly families in the foster care system that would be willing to take you in if that's where you end up.