This to be copied at this level to really errors.

Copying the dict inside the function call won't help because the same object is being assigned inside the loop, so it doesn't matter if copy was passed because we'll still get RuntimeError after assigning a changed dictionary.