Is it possible that the name of the CI is not the most unique identifier, are there perhaps multiple CIs with the same name, but maybe have a different family/class, or maybe have a different serial name to make them unique?
You may need to include additional values for the provider, perhaps serial_number, family or class.
NOTE, when looking for CIs with the same name, also check for inactive CIs.