It is absolutely not a fact. There are a slew of papers on both sides of the argument, so it's definitely not settled.
People with mental health issues are more likely to use cannabis because it helps them with those issues. And people with mental health issues are of course at higher risk of developing psychosis, so it's a self-fulfilling prophecy.
“Results: Consistent evidence, both from observational and experimental studies, has confirmed the important role of cannabis use in the initiation and persistence of psychotic disorders. The size of the effect is related to the extent of cannabis use, with greater risk for early cannabis use and use of high-potency varieties and synthetic cannabinoids. Accumulating evidence suggests that frequent cannabis use also increases the risk for mania as well as for suicide.”
One of many. I have a close family member who developed cannabis-induced psychotic disorder in teenage years. It is a well known phenomenon. I agree that it can be a chicken-and-egg question in some cases but it doesn’t change the fact that cannabis is generally bad for your mind.
Another one in the Lancet:
https://www.sciencedirect.com/science/article/pii/S221503661...
“The ready availability of high potency cannabis in south London might have resulted in a greater proportion of first onset psychosis cases being attributed to cannabis use than in previous studies.”