Issue #22653: Fix an assertion failure in debug mode when doing a reentrant dict insertion in debug mode.