Amazon is reliable, sure, but what do they have - 99.9% fulfillment, 99% on time, 99% with authentic products, 97% of listed products in stock? Those are guesses, but apply those numbers to delivering vital daily medicines and the problem becomes pretty obvious.
Keeping in-stock rates high and "on time with authentic products" rates near 100% is not an easy task. It's not something pharmacies do perfectly either, but their shortages are generally at a store level rather than national, and they're not asking people to completely switch delivery mechanism to trust a space with online one provider.