This is an interesting error - the "An item with the same key has already been added" is incredibly misleading. I have found that this error is down to multiple broken links to the same document in a Topic (sometimes Glosary entries, sometimes Frame Links). I think UPK creates some kind of a 'missing document' index, and when it hits the second link for the missing document, it tries to add the document to this index, finds that it is already there, and craps out. It's a bit annoying because a 'broken link' will only generate a Warning, but this 'same key' generates an Error, which stops publishing.
For me, I removed the broken links and it worked fine. As a test, where I had two broken links to the same document, I removed one of them but left the otheer (single) broken link in place, and as expected I got a Warning (broken links) message but publishing still continued. Which proves that it is the _multiple_ that is causing the issue.
Let me know if this fixed it for you.