FWIW, I've found ibuprofen to be the absolute best for my post-surgical pain. The issue is that it's 600-800mg every 6 hours to remain effective, and that's pushing some limits on dosage. Doctors have always told me fine in the short term, but bad longer term.
I know I'm saying this with a clear mind and pain free body right now, but I'm entirely unwilling to fill an opioid prescription in the future. The small amounts I've taken in the past for surgery were just too memorable - nothing should stick in your brain like that years after and be considered safe.
Anecdotally, the biggest potheads I know can take a month off without impact to their lives.
Regarding anxiety and panic attacks, I'm sure that's possible, but people don't die from it. An extra cup of coffee would do something similar for a longer period of time.
I don't think we've studied cannabis enough to truly know the negatives, but even heavily discounted historical and anecdotal evidence would suggest it's less harmful than opioids. That potential for harm might be low enough that you simply try it first for pain management, before moving on to stronger things that carry their own sets of risks. I'm not a doctor (or a cannabis enthusiast), just what I think I think.
I agree that anxiety can be an issue especially with novice users, but those effects vary person to person and strain to strain.