If those costs are paid for by taxpayers then the consumers are in effect involuntarily buying products they would not have otherwise bought, just with more steps. We already see this with agricultural subsidies.
If those costs are charged back to the producer then it becomes economically optimal to under-produce, which will cause prices to rise and risk shortages but eliminate waste. One can make the argument that higher prices for basic goods to reduce waste is a social good but it also impoverishes consumers.
All of these scenarios have happened empirically countless times. That almost every producer over-produces to some extent at no profit to themselves when allowed has strong "Chesterton's Fence" characteristics.