Under the caveats of a competent physician and a completely med-compliant patient, opiates are perfectly safe. Those are enormous caveats though, given the history and prevalence of incompetent physicians and noncompliant patients (at least in the US).
Generally if you see someone complaining about opiates being dangerous, they’re likely factoring in opiates as things that exist in the context of society rather than a strictly clinical context. You can’t really use the reasoning of one context to dispute the other, it looks silly because you have to say stuff like “ignore all the deaths and the mechanism of those deaths”