Creating Customer via REST API throwing DuplicateEntryError

I added some custom fields in the Customer doctype and I also use a custom naming series TA-.####. It’s been fine until recently. Whenever I try to create a Customer I get:
frappe.exceptions.DuplicateEntryError: ('Customer', 'TA-03894', IntegrityError(1062, \"Duplicate entry 'TA-03894' for key 'PRIMARY'\")).
This is weird because it’s meant to automatically auto-increment. I also checked and isn’t the last record in the Customer table. There’s TA-03890 - TA-03899. Any idea what could be wrong please?

This post may have a solution: Print Preview Error {{body}} - #11 by brian_pond