This was a problem with returning the remainder if there are valid storages, but they are all in extract-only (the #insert call never propagates to IStorage in that case). If stack.size differs from size, the stack with its wrong size is returned literally as remainder in that case, which breaks an assumption in the interface.