What would have been better? To just say "I'm sorry you're having a hard time". If you don't mean something, don't say it.
While it may seem like I am being oversensive about the subject, it is understandable because I left out a large part of the context. When you have heard of this phrase hundreds of times over multiple years by people who were not in the position to help you in the least bit, it becomes a meaningless platitude.
I don't personally say that sentence outside of a work context; usually I would say "call me if you need to talk", but I won't take proactive action unless I believe my friend either wants me to or need me to.
At the end of the day, someone makes a choice to interpret this as a platitude. How about taking up the person on their offer?
Unless the person saying it had access to some experimental treatment my doctors don't know about, there really was nothing they could have done to help me. I knew it and they knew it.
So while I didn't get angry at them (because I knew they said it because didn't know how to react differently), it did annoy me as it was basically an empty promise.
But there is a difference between empty platitudes such as "thoughts and prayers" and a genuine albeit abbreviated "I'm your friend and I love you, I don't know how I could help you, but if you know, don't hesitate to ask on account of it being too much."
I'm sorry about the situation you are/were in. That must have been very difficult.
It's like forgiveness, if you forgive someone, the main benefit is to you. By forgiving someone you take a load off your own shoulders. It's often meaningless to them if those forgiven know they are.
I understand your point and i know it's a difficult question to deal with sometimes, especially during depression.
But remember that you're not those people's top priority. That sentence means you are allowed to ask them for stuff, but it doesn't mean they're going to drop everything and take you into their care right now without you taking a few steps on your own. They consider that you have enough of your own agency.
Your willingness to be helped is nulled by that same lack of initiative on your part.
A trick is to find something easy to ask for, as a go-to response to that. For example, the next time someone says that to you, you could answer:
"Actually, life has been tough lately, a beer would be nice".