It's entirely plausible that some people have hereditary character traits that make them less resilient to stress. They're not necessarily depressed
because of their genes, but their genes make them more vulnerable to depression.
We observe a similar phenomenon with diseases like type 2 diabetes. People of south Asian origin have significantly higher risk of developing type 2 diabetes, even after controlling for diet and lifestyle factors. We have identified a cluster of genes that don't directly cause diabetes, but seem to increase the risk of developing the disease. You aren't doomed to develop diabetes if you have these genes, but you do need to be more careful about your diet and lifestyle.
https://www.nature.com/articles/ng.921