I would go back in and take the CPU out check the socket pins for damage as well as the chip. I’m suspecting you didn’t mount it properly, this is a common issue in the iMac’s as the heat sink makes it hard to properly align it and then the proper process of screwing the screws.
Think how you tighten the tire rims lug nuts. You criss-cross the tightening so the rim sits firmly and flat onto the hub.
Here we use the same approach! Slowly tightening the screws in the same pattern so the pressure on the chip is equal across. If not some pins won’t make contact, at worse the chip can be cracked!