some places already do this for food where anything thats after sell by date but still safe to eat has to be donated to a food bank.
i think it should be expanded to cover more categories than food and clothes when reuse and recycling infra grows to take the demand. its not just good for the environment it also prevents producers from restricting supply to keep their profits high.
the ultimate goal is make it illegal to destroy or intentionally damage anything usable before it reaches consumers. that would create a new ecosystem of discount stores and giveaway centers, and save everyone a ton of money.
It may be an incentive to produce less and restrict options available. It really depends on how much harm it does to the company to donate or mark down their product.
Who pays for the logistics cost of moving and stocking these products in discount stores and giveaway centers? That is a large percentage of the total cost of production and the reason disposal is cheaper.
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.