Yes, you're right. Opioids are a good choice for short term pain. They're a good choice for end of life pain. They're a poor choice for long term pain, although they serve some use if carefully prescribed. Weirdly, the US prescribes a lot of opioid medication, and prescribes it for people with long term pain.
Some of this is because the VA said that untreated pain was an injustice, and said that pain should be the "5th vital sign". That was pretty disastrous. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1924634/
Lots more information from England here: https://www.fpm.ac.uk/faculty-of-pain-medicine/opioids-aware