In isolation, it is theoretically possible for gabapentin, pregabalin, baclofen and the like to cause some constipation, although I have never heard of it reaching the Shitting The Pineapple level. Beta blockers, antihistamines, sedatives, a lot of benzodiazepines and the like also have this effect, and it is more marked with anticholinergics.
This kind of thing is very variable from one patient to the next.
It is more likely a combination of this constipation liability with a much stronger contribution from the residual effects from opioids. Remember that the body can actually store opioids it does not use right away -- enough to slow the development of withdrawal and show up in sub-threshold quantities in drugs screening/toxicology panels for up to a year after cessation, especially in the case of the more lipid-soluble narcotics and one is losing a lot of weight during this time.
For example, when I started with a new pain specialist about 25 years ago, there was one smart aleck nurse who apparently thought all people on narcotics were junkies, so I told her to go right ahead and do a nalorphine challenge test to see that I was not dependent on opioids in high levels, but the doctor overruled the nurse on this because a test like that a little over a week of coming off being on very high levels of hydromorphone and morphine would be dangerous especially because of my heart.
All new patients of the pain clinic get a panel which essentially skips the immunoassay and goes straight to the GC/MS, HPLC, and FTIR to find everything which is lurking in there mainly as a means of preventing untoward medication interactions, and metabolites of diazepam showed up at something like femtomole levels, maybe fewer than 10 000 molecules of the stuff in that blood sample, eight years after my last dose, and there were also trace amounts of dextromoramide and piritramide from 12-21 months earlier.