Problem moving a node to and from a tree

Hi

I have a function where i move a node from one tree to another and another to move the node back to its original tree.

When i move the node back to it’s original tree position i get the following error, then the node is inserted correctly.

Error type: getItem
Description: The item 16819688 not operable. Seems you have non-unique|incorrect IDs in tree’s XML.

Additional:
What is supposed to happen when i add an item to a tree with a dupe id?

If i add an item with a dupe id to my demo, it replaces the old item. In my live version, 2 items are created.

We need the complete demo to reproduce the problem.