I didn't see the specific number the article quoted in the link you mentioned, but it looks like the tracking is based on what drugs were involved not context so I'm not sure how many of those deaths are in the context you are describing.

One thing that surprised me when I looked into it a little bit a while ago is that benzos + opioids were the most common combination involved in fatality (in New York city IIRC, not specific to type of opioid), followed by alcohol + opoids. But it made sense when I learned that the thing that tends to kill people with opoid overdose is not breathing. Pain can make it really hard to sleep and stuff that helps you sleep can also bring you closer to not breathing.

I'm not sure how many people on long term opioid prescriptions regularly use a recording pulse oximeter overnight, but I'd guess very few. There seems to be some connection between long term opioid use and central sleep apnea [0]. It sounds like apnea is considered a known complication at this point [1] but I don't know how well doctors are monitoring for it. I don't know if there is any evidence to support or refute this, but it at least seems possible that some number of the deaths could be from people who have breathing trouble at night for a long time without realizing it and something relatively minor might be enough to kill them.

I couldn't find anything if prior obstructive apnea is linked to opioid deaths, but I did find an interesting letter to the editor [2] that references an interesting retrospective study on opioid deaths in Canada using prescription information [3]. A quote from that study:

"In the primary analysis, 593 deaths met the inclusion criteria for this study ( Figure 2 ), including eligibility for public drug coverage, receipt of an opioid prescription overlapping the index date, and no evidence of cancer or palliative care. Of these, 498 (84.0%) were matched to at least 1 control. The coroner’s toxicologic screening detected more than 1 opioid type in 193 (38.8%), benzodiazepines in 301 (60.4%), and ethanol in 92 (18.5%) of these cases."

That seems like an amazingly high number of people with benzos in their system at the time of death. If I understand the study correctly the data table is showing that in 84.5% of deaths and 64.4% of controls there was a benzo prescription within 180 days (for controls index date was the same as the day of the matched death). I could imagine that often benzos might often be tried before starting opioids, so I'm not sure how often people have prescriptions for both at the same time but even if not that often many patients seem likely to have them available. I can easily imagine for someone in pain that a small (even if not that small) chance of death can be easy to overlook when trying to sleep. I am amazed that there aren't more people who die due to this. [2] mentions some alternative sleep aids that might be less likely to cause respiratory issues.

[0] Filiatrault et al. 2016. Medium Increased Risk for Central Sleep Apnea but Not Obstructive Sleep Apnea in Long-Term Opioid Users: A Systematic Review and Meta-Analysis. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4795290/

[1] Kahan et al. 2011. Canadian guideline for safe and effective use of opioids for chronic noncancer pain. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3215602/

[2] Geller. 2017. Opioid therapy and sleep apnea. https://www.mdedge.com/ccjm/article/129989/pain/opioid-thera...

[3][PDF] Gomes et al. 2011. Opioid Dose and Drug-Related Mortality in Patients With Nonmalignant Pain. https://www.researchgate.net/profile/Michael_Paterson/public...