Basically this, man, exactly.
That's what people mean when they say cannabis can be a catalyst for pre-existing mental issues. It's not that cannabis directly causes the issue, because it doesn't. What it means is that a person was predisposed (either genetically or otherwise) to a certain illness or condition, and the introduction of cannabis into their body/brain chemistry is just enough to set that illness in motion and/or amplify the symptoms to the point that they're finally noticeable.
Weed isn't alone in this. As far as I know, every psychedelic/hallucinogen carries the potential to "unlock" abnormal thoughts and behaviors that you otherwise would've been able to keep at bay.