Arduino Nano ESP32 stuck in firmware bootloader mode

You need to call rtc.begin() before you try to read from it.

It’s sounds bricked, but you should be able to get it to accept new code if you jump the reset pin to ground twice within 1 second.