I have spent a lot of time wondering about this. My partner and best friend both insisted they wanted to help support me through my depression and suicidal ideations, but within a month both had turned their backs on me. It felt like they set me up to have a mental breakdown…getting me to open up to them, saying they'd be there for me, then turning their backs and walking away when I was at my lowest.
This may not be satisfying but I think the reality is that people are very selfish and most of them can't handle the visceral reality of true depression in someone else. Sometimes they want to go through the motions to offer support or say the right thing, but actually showing up is beyond their skill set. I don't think people who care about us mean to make our depression/anxiety/whatever worse, but yes they often do. It's always so frustrating and painful, especially when you're reaching out for help/support.
In my case, I feel completely betrayed by the two people I cared the most about. It's made me original mental health struggles so much worse.