You're just assuming that glass is better than plastic.
I challenge that assumption.
Glass is much heavier and bulkier (so a truck will carry less product, and burn more fuel and cause more road wear to do so), and more product will be lost to spoilage.
Glass also takes a lot of energy to produce. In many (most?) cases more fossil fuels will be consumed making a glass container than the plastic equivalent.
The same sorts of issues apply to coated paper or card containers.
Glass is also somewhat difficult to recycle. The actual recycling is easy, but different colors of glass needs to be sorted. And glass is heavy, so it’s costly to transport.
I think if you really wanted to go all in on glass recycling you'd have to ban everything except maybe 3 colors (Something like clear, a light green, and something quite dark).
This is good, because transportation costs can be easily accounted in the final price of the product. Paying higher costs make people more honest about how much they want to spend for the privilege of buying small bottles of a product.
Even this assumes that people will bother to even transport the heavier alternative. There are places in the world where goods just won't be available anymore. Doesn't affect me, but not every place on the planet gets to make choices like "just switch to glass".
I challenge that assumption.
Glass is much heavier and bulkier (so a truck will carry less product, and burn more fuel and cause more road wear to do so), and more product will be lost to spoilage.