I do recall seeing an article about a company that developed a carboard packaging system. It scanned the items on a conveyor belt (or whatever) & as they arrived at the packaging point it had a correctly sized cardboard box manufactured, in a few seconds, to suit that item. The idea to make a saving in waste & reduce mailing costs. Plus make a better package for the item in question.
Not sure about cost; but for a company like Amazon, shifting different sized items, one would have thought that it would save in packaging storage & operator selection of packaging alone