AR errors

A credit note was created and the system automatically generates a credit note number but an error batch was generated with the message  CN00ABC already exists. Why would the system generate a credit note number which already exists?