This same error just popped up on me today while using the Upgrade Planner mod to replace 80 stone furnaces with 80 steel furnaces.
I reloaded the save, tried again, and again same crash.
Reload save, replaced 10 furnaces, no crash. Replaced 20 furnaces, no crash. Replaced 40 furnaces, no crash. I'm guessing there is an issue with the number of things being replaced in one go.