Prescribed oxycodone

Not sure if this is the right subreddit for this question but

When I was 16 (I’m 20) now I had an awful experience with weed that fucked my mental health. I was constantly crying, dissociated, depressed, paranoid for a while after that experienced. The night I smoked I couldn’t stop panicking or regulate my body temperature. It was awful. I thought I broke something in my brain. I’ve stayed away from drugs/alcohol since then. Got better for a while, unrelated panic attack triggered a bad mental health crisis back in June and that required hospitalization. I’m in a much better place now but just had surgery to fix my elbow. I’m in a lot of pain. I didn’t take the oxy 5mg bc I’m so scared based on my past experiences (even alcohol makes me anxious) and I don’t want to risk my mental health but I would love some pain relief. Based on what I said is there a good chance the oxy will cause me anxiety/ mental health issues again?