That table has links with both of those domains, so when you try to remap them you get a duplicate key. It’s not a bug. You’re trying to create a duplicate key.
You could remove the items from that table that have the apex domain. A better idea is to use www instead of the apex domain.