Assuming the patient isn’t locked into a pharmacy by their PBM, there might be incentive for the pharmacy to expose their inventory. Otherwise, the PBM or the manufacturer may have incentive to know or share that their beneficiaries or end users have access to drug. 503B compounding pharmacies and GPOs would have an incentive to know which drugs are difficult to purchase.
Market failures and special access programs notwithstanding, almost any drug can be delivered by the wholesaler to the pharmacy next day.