The most difficult thing about this problem is mixed size boxes. Knowing where every box is is easy when they're all the same dimension and stacked neatly, but what about when they're packed randomly, many boxes are askew, and they're all different sizes? Then you need to get into complicated time-of-flight sensors, point clouds, surface/box recognition logic/AI, etc..
I really do think the same could be applied to shipping packaging.
There are 12 sized boxes and that's that. They need to be stacked a certain way.
Or maybe a bit of flex here and there for some things.
Nobody really has the wherewithal or power to do that, but you know ... Xi could. I can see that being something China imposes, and then it's a standard that naturally gets exported.
Obviously for distribution of stock you could probably be smarter about it and waste less space/cardboard since you've probably got lots of each size of item.
[0] - approx 90 in Japan in 2016 - https://dailyportalz.jp/kiji/170303198940 (thought that was fun, submitted here: https://news.ycombinator.com/item?id=29746745)
For end-consumer shipping, they should frankly have boxes that 'fit' perfectly.
Amazon should have a 'box maker machine' that makes all the dam boxes on the spot as needed from cardboard.
Or forget boxes, how about a really light mesh?
The work Amazon has done to change box types, switch to bags, etc., has reduced waste considerably per package, though I suspect the absolute amount of waste has continued to increase with business growth.
Of course, the reason we were re-stacking pallets is because our original managers were so bad at managing inventory that the 20ish backstock carts were full, so we would routinely have 15-25 pallets of backstock in the warehouse... when ideally the carts should only ever be half full. Saved their jobs when I took the order gun from them, lol.
To unload you most reverse the process. Unless it gets busy then you just pull the whole wall down at one time and bulldoze the boxes onto the rollers.
Restacking pallets in warehouses is way harder. It’s more like building a house of cards but no card is the same size.
I think this is actually a basic rule in packing / loading. Get the big things in first and then work around them with the small things. It's how I load my car when going on a big trip. The main exception is things that you will need quickly without having to unload everything.
'Big things first' is also why mixtures (e.g. muesli) settle in transit with the larger pieces at the top and dust at the bottom. Small things can work their way under the big things but the converse isn't true, unless the whole volume is vigorously shaken.