Fix Loaded event processing after a handler throws (#21877)