In California, the pharmacy computer queries some state database to log the purchase and get approval. If you buy too much too quickly your purchase will be blocked.
My closest pharmacy “loses its connection to the system” frequently which results in them being unable to sell me the medicine. The computer will refuse to ring it up.
Plot twist, for employee safety the store policy is to always say "lost connection, sorry" when the system detects suspicious purchasing patterns.