Suppose, instead, that the SELECT also added the index_id columns to the ON constraint between the first 2 tables. In other words
FROM sys.indexes i
INNER JOIN sys.index_columns ic
ON i.object_id = ic.object_id
INNER JOIN sys.columns c
ON ic.object_id = c.object_id
AND ic.column_id = c.column_id
WHERE ic.object_id = @OriginalTableObjectID
AND i.is_primary_key = 1
becomes
FROM sys.indexes i
INNER JOIN sys.index_columns ic
ON i.object_id = ic.object_id
AND i.index_id = ic.index_id
INNER JOIN sys.columns c
ON ic.object_id = c.object_id
AND ic.column_id = c.column_id
WHERE ic.object_id = @OriginalTableObjectID
AND i.is_primary_key = 1
That retains the primary key filter as is but makes a more correct association between sys.indexes and sys.index_columns for this purpose.