I think it's because it uses the array length, when it should be checking the stored offset of every loaded interior.
Possibly good for a new function, 'GetFreeOffset', or GetNextFreeOffset'? 'FindFreeOffset'?
Just continually loop through interior.storage_offset?
I have an idea:
for ipairs the loaded interior list, local number, + 1 for every iteration until you find one that doesn't match! Either we run off the end, or find an empty spot.
Or could probably just use k, but this is maybe more reliable? Dunno.