But remember that capitalism doesn’t optimize for minimal physical waste - it optimizes for minimal waste overall.
This includes cost of capital, human brainpower, opportunity cost, taxes, input material, and of course, physical waste.
So the optimal product doesn’t necessarily last forever - that would involve an unaccetable amount of investment in material and labor.
One must also take tech progress into account - consumers may not want a product that lasts forever, since they might want version 2.0 some years down the line, and throw away a perfectly functional version 1.0.