Using espflash is one way to install the serial communication (bridge) firmware. The other way is through the IDE. From the above screenshot, evidently the ESP did go into bootloader mode and has accepted the firmware update, which would confirm that the ESP32 is working.
It may be that the RA4M1 bootloader has been overwritten or has got corrupted for some reason. The weird matrix pattern might be explained by some of the pins "floating".
The RA4M1 bootloader file can be found with the Arduino Uno R4 Boards package that has been downloaded into the IDE. On Windows, this should be in the following location:
\Users\<YourUsername>\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.6.0\bootloaders\UNO_R4\
This assumes that version 1.6.0 is the version you have installed, otherwise modify the version number in the path. The file is dfu_wifi.hex.
The Renesas MCU needs to be put into bootloader mode, which is done by shorting the BOOT pin to GND. The BOOT pin may not be marked, but it is the last pin on the header with the power connectors, next to the IOREF pin. The board should then hopefully show up in Device Manager as "Renesas RA USB Boot". You may need to press RESET once.
To flash the .hex file you will need the Renesas Flash Programmer. Using the command line you enter the following command:
rfp-cli.exe -device ra -dtr -port COMx -p dfu_wifi.hex
Obviously substitute COMx with the actual port ID. The -dtr flag is important. I think the baud rate needs to be set to 2400, but not sure.
Lets hope that is all it is. I was a little concerned about the mark that is visible in the photo on the RA4M1 chip:
I am hoping that its just a smudge of something and not a scorch mark.
PS, just a point to bear in mind - while the screenshot was quite clear and with decent resolution, the forum usually likes textual error output to be copied as text into the post and then enclosed in markup using the <CODE/> icon on the post editor task bar. It is also possible to manually add the three backticks ``` (character usually on or next to the Esc key) to the top and bottom of the error text. This formats it in an appropriate way and makes it easier to read.