Set Family Instance Type by an Excelsheet (Problem wit Sort List by Key)

Hi,

im trying to set the family instance type of my foundation elements by an excelsheet.

It works fine, if i only have less then three elements where i want to change the family type.

But when if i try to do it with more then three elements i get an error from List.SortByKey (Key operation failed.Number of items does not match the number of keys) (Image is in the next post).

Where is my mistake?
In my opinion the number of items is equal to the number of keys.

Thanks for your help!