I recall seeing this issue in the past, when I removed a node from a zone, then tried to move another node into the same zone and both nodes had the same IP.
The system had not actually updated the database yet and kept telling me the IP already exists. Could take quite a while, but this usually resolved itself (or I grew impatient, restarted the service and tried again).
Haven't seen this in a while though. We're running 2.2.4. If you are running an older version, there may have been changes/fixes regarding this behaviour?
If you have an unreferenced object, you probably need to shutdown the NetXMS service and run nxdbmgr check to clean that up. Not sure if you can safely delete the object straight from the database without leaving leftovers somewhere.