Mental illness has a genetic component. It's not a given that you'll get it, though. It's more like a vulnerability.
Usually, it takes a stressor to trigger it. Living the JW lifestyle can definitely trigger it. Being disfellowshipped is an extreme stressor that causes extreme stress even to those not genetically vulnerable.
In my case, there is a definite family history of mental illness. This is in nonJW family so there appears to be a genuine genetic component.
I started suffering depressive symptoms at about age 15. I was stressed out about the JW lifestyle, though still confused about it being the truth. My mom suffered depressive symptoms as well and was difficult to live with. All these things were stressors. To my mom's credit, she did talk to the doctor, but I was not diagnosed.
I was disfellowshipped at 18 and went throufh a suicidal depression. I did not go to the doctor at that time, but after being reinstated and moving out on my own, I did go to the doctor and get diagnosed with depression. I was put on medication and did well until I had my son. The physical stress of a difficult pregnancy and post-partum period with all the hormonal changes was more of a stressor than my body could handle. I was diagnosed with Bipolar Disorder, Postpartum Onset.
I was hospitalized at that time and again a year later. I've been on a good medication regimen and have for the most part been functional for the last dozen or so years, though I do have some occasional difficulties.
The problem is my mother just blames it all on genetics. It's obvious, personally that the JW lifestyle was a big contributing factor, especially being disfellowshipped. That was the end of my being able to function without medication.
If I had had a different upbringing would I have avoided bipolar disorder? Maybe. There is no guarantee that I wouldn't have had any other stress and, indeed, it was the stress of having a child that really pushed me over the edge. But, I know, personally that having a different, more healthy upbringing would have been one less stressor and I would've had a much better chance of avoiding the most extreme expression of my genetic propensity.