I've seen the error 'An item with the same key has already been added' several times. I usually document the errors that I get in eConnect (and we'd like you to do the same here):
Trouble with AA in an eConnect PMTransaction
and the same issue here:
eConnect - PM Transaction with Analytical Accounting
In today's problem, neither of these two was helpful. Here's what fixed it