I disagree. Life 500 years ago was a constant struggle to stay alive. That left very little time to sit around and be depressed.
For those humans, at that time, who were mentally ill, I agree, they either died from exposure or were protected by other humans. That protection was expensive, though, and wasn't available to many families.
I don't follow your take. If you were sick 500 years ago your survival chances were low. If you are sick today your survival chances are lower (but not as much). Why is depression any different ?
Same could be said of hunger or tiredness. In other words, depression can be an unwanted, but inevitable byproduct of our internal workings - same as being tired is.
My guess is it caused people to stay home and keep their head down when things were going badly. Which may have been functional in a violent tribal ancestral environment but maladapted for the modern world.
For those humans, at that time, who were mentally ill, I agree, they either died from exposure or were protected by other humans. That protection was expensive, though, and wasn't available to many families.