Yea, it's out of touch to tell someone with broken legs to walk it off. But, if someone got the wind knock out of them. That's perfectly fine advice.
In fact, I hope and believe the majority of mental illness cases are not serious. Like, most physical cases. It's just harder to see, so people have a harder time properly categorizing it. Which is damaging to a person psyche. If someone has a sprain ankle, but thinks they have cancer. Imagine the unnecessary trauma and hopelessness the person is experiencing.