If the scheduler HZ is <1000, then small calls to the Arduino delay() function (such as delay(5)) will return immediately. The default HZ is 100. I recommend adding CONFIG_FREERTOS_HZ=1000 to the sdkconfig.defaults for espidf-arduino-blink and espidf-arduino-wifiscan, since people often clone these projects. I'm happy to create a PR for this if you think it makes sense.
(Also, the Arduino core should be better implemented so it works even with chunkier scheduling HZ. I'll file a separate bug about that.)