I think that 'product of capitalism' is a misleading way of looking at it - "disability" as a coherent category is a modern capitalist framework, so in that way yes. But as to 'would this have happened to my brain if I didnt grow up in capitalism' thats an abstract question bc if you grew up in communism you'd be a fundamentally different person than you are today, so it's an unprovable counterfactual & leads to a lot of kneejerk reactions. There is no universal "You" somewhere out there in the stars. You are a product of the world you live in.
In pre-capitalist societies, there wasn't an idea that all these different ailments (blindness, deafness, leprosy, mental illnesses, etc) were all a part of this one big umbrella, there was specific ways ppl would treat specific people, but no universally applicable category bc different 'disabilities' have different effects on people.
Now this isn't to say we should go back to that, obviously it was incredibly inadequate - it's just to show that having an umbrella category of "people with things wrong with them" is a social choice, and that social choice leads to the development of certain social institutions, social norms, and practices. It's a consequence of capitalism seeing every person as only 'worth' whatever they can contribute financially.
The word "ability" (and consequently "disability") was first used in this context in england to figure out whether a given person should be sent to the Work House or the Poor House, and it was explicitly used to be a quick guess of 'can we wring any sellable Value out of this one?' before moving onto the next one.
Thus, "ability" should be understood as "ability to be exploited" & "disability" as "inability to be exploited" ("exploit" in the marxist sense of, roughly, 'someone else wouldn't be able to make their living without your work').
So what would mental health look like beyond capitalism? Well as a first universal, people would have full control over the products of their own labor, and things would be made for their usefulness as opposed to profitability, so people wouldnt need to prove to capitalists that they're productive enough to deserve to eat (or pitiable enough to eat on someone else's dime).
"from each according to their ability, to each according to their needs" is the most disability-supporting maxim imaginable, and any society not living up to that is failing people.
Your brain is plastic, it is literally impossible for it to not change in response to a changing environment. That also points to your lived environment being an obvious major factor in developing your brain meat to the point it is today. "Nature vs nurture" is a false binary, you are Always & *Only* acting in response to your environment, in comparison to past environments. Plastic changes its shape, but not all at once.
As to "well what if the world got rid of capitalism tomorrow - would I still have trouble with X or Y" if you have trouble with it today, you'll have trouble with it tomorrow. The question is about repetition & the new environments your brain adapts to, as well as broader societal health (mental & physical) programs being a natural new focus, now that production is no longer oriented for profit.
The question is about how we live as vacuum-sealed individuals atomically living in our own individual worlds - that would change, you would be able to live and interact regularly with friends who know whether you experience specific problems & would be driven to check up on you about those out of love and comradery. Having everyone live in their own boxes, sealed away from each other is an ideal handed down to us by the Settler Colonial history of the US & the US's influence on global structures in the last 500 years. "You too can be the brave cowboy living on the frontier, not needing anyone else to take care of you".
Of course that image is completely inaccurate but it's what we have, bc it's also what's easiest to profit off of.
The question isn't so much "capitalism created x or y & communism will fix it overnight", the question is more about "how is capitalist society hindering each of our growths as individuals" by adding stresses, anxieties, and dangerous norms.