There was a simple missing check of adding an inferred error set to itself, in which case we should not try to mutate the hash map while iterating over it.