player.openInventory(player.getInventory());
This code causes player to open inventory with 41 slots (not divisible by 9) thus creating invalid state in bottom inventory of InventoryView. I've created a simple plugin to trigger that - jar and source code in attachments. Try spreading or placing items and you should see them jump around, disappear or be placed in inaccessible part of player inventory (offhand/armor).