The replace_with_item can be added to the slot of the wield item, which is afterwards overwritten. This causes item loss.