The same problem, and solved.
The three arguments of the API is: old, new, black_list
To replace "old" with "new" in all receipts, except black_list.
You can just put the error ones in the black_list.
My "engine-unit" is wrong, just modify it like this:
GIR.global_item_replacer("iron-gear-wheel","small-parts-01",{"iron-gear-wheel","small-parts-01","casting-gear", "ungine-unit"})