Player/HumanEntity#setItemOnCursor(ItemStack item) sets the cursor item which I am using for my inventory click event to make a rename token. The set value is being changed but it's also not removing the previous item as the Javadocs describes on the cursor. The player is then able to keep a copy of the original item by placing it in an open slot while the set item (the token) is dropped to the ground once the inventory has been closed. If the item is still on the cursor when the inventory is closed the expected/set item drops. This set item is also the value that is returned when you run #getItemonCursor.
The set item should replace the current item held in the cursor so the original duplicate item cannot be placed into the inventory. Currently as stated above if the original is held in the cursor and is not placed into a slot the expected item is dropped not the stone.