I get the same message in one of our NB domain. We get the error when we swap the tapes between the robotic library, and one of our barcode scanner has limitation, where it can read only first 6 characters (RobotA) and other scanner can read all 8 characters (RobotB).
Media Barcode: NB1234L4
Media ID Generation: 1:2:3:4:5:6 (for both robots)
On inventorying RobotA:
Barcode: NB1234
Media ID: NB1234
Now, i eject the tape and insert in RobotB:
Barcode: NB1234L4
Media ID: NB1234
When we swap the tapes between the robots, the barcode detected is different, but the Media ID (NB1234) is already present (not unique) in the Volume DB and hence the error message "media ID not unique in database (34)". This is the behaviour of NetBackup, so to overcome; instead of deleting, we use VMCHANGE command to change the media barcode prior inventorying the tapes which we swap.
Hope this helps you!