I got this error while pasting one of my raidable bases. Not sure what item this refers to that cause the paste to crash, but I found a fix by making a ContainsKey check in PasteEntity:

Replace this line:

pasteData.EntityLookup.Add(oldId, ioData);​

With this line:

if (!pasteData.EntityLookup.ContainsKey(oldId))
{
    pasteData.EntityLookup.Add(oldId, ioData);
}

Hope this helps!