Its definitely messed up and good you are sharing your story. Nearly 90% of "health professionals" I come across are far from that. Always be careful what a doctor says, and always get a second opinion if their answers don't sound right. Them forcing this stuff against will is just outrageous.
At your age you are still finding yourself. Along with the stress of wrapping up your degree. Moving here, moving there, working new jobs, looking for new jobs, constantly meeting new people...its all very stressful. Especially for someone with a high IQ such as yourself. The brain is really powerful.
A similar thing happened to my friend. It took me years to finally understand what was going on. He drank obscene amounts of alcohol throughout his teens and early 20's to where he would get violent drinking and fight a lot (who doesn't to be honest). Then taken away into detox to DT. Alcohol withdrawal certainly causes psychosis. He was put on all kinds of meds. Of course the meds didn't help and only made it worse. He tried to kill himself and all that. What he needed was maybe some good therapy is all. He was born in vietnam, so had lots of trauma when he was a kid. Sadly, at this point there is no way he will come back. All the (pharma) drugs he has been on the past 15 years has ruined him.
Some people may need this stuff, however if drugs / alcohol are involved, its completely different.
I had some serious paranoia around your age too. And now in 2020 its happening again to me. I had some slight psychosis from my last alcohol detox, combined with the stress of covid, life, my career, money, bills. Too much weed and I might just start freaking out.
Also, when I spent too much time alone, its not healthy for me. The distraction / comfort of being around others is priceless. If you lock someone in a room for a year alone. They will come out insane. As they just spent 365 days in their head.
Just take it easy on the weed

You will be good. Not sure if you looked into things like meditation. But it will help you get your bearings faster.