No not at all. “Self pay” was your status and those people pay the highest rates. This is true for almost all US healthcare. Being self pay is basically like going to a car dealer and paying MSRP with no negotiation or rebates, etc.
The pharmacy has agreements with wholesalers (sometimes directly with manufacturers) that determines their cost structure of inventory. This includes discounts and rebates and a lot of other cost reductions but All these drugs have sticker price. Insurance companies drive volume and can decide which pharmacies their patients use, thus they can negotiate prices as well. The pharmacy<>insurance transaction is usually going through a PBM, another middle man, that can tell them pretty much instantly what you owe based on your coverage (this is why a pharmacy can give you accurate pricing but doctors offices can’t). There’s a lot of intricacies but the difference between self pay and insured rates can significant. For a generic, I’d be surprised if the pharmacy paid more than 5-20$ but billed you what they could. When insured and you pay 10$, the insurance company has done the math that they will profit on their total generic base even if they lose a little on your purchase (but they probably didn’t).
I work in healthcare finance currently at a pharmacy