The table has a UNIQUE constraint, and identical rows sit in it in pairs. If at least one column of the key is nullable, this is expected behaviour: following the SQL standard, PostgreSQL treats two NULL s as distinct, so a row with an empty field never matches any other row, not even its own copy. No error, nothing in the log, the constraint is in place.
We hit this in a service table next to a 1C:Enterprise database, caught by the final test of a migration. Below is the procedure we now run on every such table: find the keys, measure how many rows are actually protected, decide what the data means, fix it, and prove the fix.…