I speak as the child you have and has now grown elderly. I can relate so much with everything mentioned here. You have all given good advice. I struggled with depression and anxiety, was shy and had a father who did not understand. I have gone through the problem of medications stop working. Here are some observations from me from a lifetime of dealing with this.
I made it through. It was tough, but I made it. All is not hopeless. If I can, so can others.
Be aware that just being there and caring makes a lot of difference.
This is a difficult time of adjustment for your teenager. Adjusting from child to adult is not easy. Your child will amaze you in the changes they can make.
Telling your child about how you had difficulties in your teenager years and how you made it through can help a lot. You did it so there is hope they can.
This time of change will come to an end when your child reaches there twenties and gets established as an adult. If your child gets a lot better and then when they get into their 30s or 40s and then has problems again, it may be a genetic predisposition to depression. This is especially true if there is a history of depression and anxiety in a parent and their ancestors. I can trace this back to my g-great grandfather. Asking questions of your parents and grandparents about this can be done, but be careful to explain you are doing it to help with your child's treatment, and not because you are trying to blame.
Fathers are taught that a male is tough and a male makes it through. Mothers are taught that they are determiners of the child you love. Both perspectives are good and needed. Fathers can and do change their beliefs in their children as mine did. Mothers can accept that not all things are your fault and that we all are born with some kind of genetic predisposition that can cause problems. We all have lived through them.
Medication that stops working was a common thing with me. We all react differently to our meds. With me it was not metabolizing the meds effectively. Thus an increase was not enough for me. Only recently my doctors discovered I needed a lot more. My medication usually is dosed at 20-40 mg. I am now taking 150 mg. This, as I said, is very variable according to the person. Genetic testing can help. Also my doctors say you can just see what happens. If the patient sees the meds stop working, it can be a sign that factors, including genetics, are at work and indicate the necessity of increasing the dosage until it finally works again. Some meds work on others, but will on you, and vice versa. So yes genetic testing can help determine what is the best for the patient. Again just trying different ones will show this. I say this because not everyone can get the test or afford to get the test.
In the end I made it through and am still making it through. Our knowledge on this has expanded so much. When I was a child the idea of chemical causes was just starting to be theorized. There were no antidepressants. And yet I made it through. How much more can today's child make it through. I was shy, now I test right in the middle of shyness and extroverted. I was depressed and now though I still have some problems, it is no longer overwhelming. I can lead a somewhat normal life as long as I continue to take my meds.
Keep up the great work you are doing in helping your child through this.