There is a thread here somewhere that some user unsucessfuly "upgraded" i5-7600K to i7-7700K on 2017 27-inch iMac. It was simply not booting. After swapping to original i5, everything was again OK. I suppose same thing would probably most happen in your situation as well.