Two error signatures sat on the same line of code, a duplicate-key error and a deadlock. They looked like one problem and were not. Here is how to tell them apart and the two small fixes, no schema change.
I published the full breakdown on Behind Methods, the studio I run. Read it here: Two Errors, One Insert: The Deadlock That Was Not a Duplicate.
Written by Ankush Shandilya.