Maybe an issue with concurrency, so the number is added after the retrieve of the complete list is performed, then this new number is not in the list but will exist in the database.
Maybe add a unique constraint on the entity level via the validations, then this will make sure the number is added only once.
Anothe roption would be not to retrieve the list and check in the list, but rather do a retrieve from the db with something like:
[RegistrationAttribute = $registration][ id != currentobject] followed with a decision if the record is found
With an index on the registrationattribute this is very fast and will prevent the concuurency issue, will perform faster and will consume less memory (certainly when the amount of registrations grows).
I hope this points you in the right direction.