Its not that we cannot build robots that restock shelves, it is that shelves are designed for humans to stock. And emulating the range of movement and dexterity of human hands and the sensory data we get when interacting with such shelves is really expensive, rather than prohibitive. Especially to maintain. Think of all the fine motor joints you would need in such a robot that could break all the time (like how fragile human fingers are). But how else are they supposed to stock individual bottles of maple syrup with weird handles while stocking jars or bags of flour a shelf over?
In situations designed for robots, like Amazon warehouses, they don't have a problem stocking shelves as long as the range of required behavior is much more restricted so the instrumentation can be more rugged and less articulate.