Since removes items from marcxml, when an item is returned, the availability information in zebra is not correct. Since the data indexed for items.onloan is depending on the fact that there is a value for onloan this data for onloan index is not UPDATED. Which is not what the user expects. either change undef to 0000-00-00 value when checking in. Either del the previous record and recreate that in zebra when it is a modification of item.
This bug is owed to the deprecated use of -nosanitize flag to rebuild_zebra. Be advised that it is a very BAD thing to use nosanitize when you want accurate information for items.