Please know that this sort of thing is not a competition. The fact that others have "bigger" problems to contend with... or at least more external vs. internal, does not in any way minimize the difficulty of what you are struggling with. Depression is real, and when severe like yours, can be completely debilitating.
I turn 50 in Feb. The idea that the best of my life is behind me makes no sense to me. To me you're in that sweet spot where you have the money and perspective to do really interesting trips and experiences, but before health issues with your parents start to take over and limit options again.
I'm divorced... again. I've been seeing somebody who lives on the opposite side of the planet for 5 years now. In some ways it's great... no restrictions on my day to day life... but in some ways it's lonely and isolating... nobody to do things with on the spur of the moment... vacations together have to be planned out months in advance.
I have found myself drinking at home alone a bit too much on days where nobody is around and I'm feeling lonely... and putting on 3 to 4 lbs a year over 4 or 5 years really adds up over time.
Not sure how much this post is trying to cheer you up vs. me commiserating, but definitely continue speaking with a therapist, AND continue to try out different med options until you find the one that truly works for you. 40 is waaaaaaaay too early to be feeling like the best of life is behind you. There is so much out there to do, so long as you get yourself to the point where you're ready to go out and do it.