Uno R4 Wifi recognised as ESP32 Family Device

I didn't use my Arduino for some time. When I plugged it into my pc, it showed up as ESP32 Family Device. I tried changing port and cable, restarting the computer and reset the Arduino. The only solution that kind of worked is when I Run espflash directly following the instructions here:
https://support.arduino.cc/hc/en-us/articles/9670986058780-Update-the-connectivity-module-firmware-on-UNO-R4-WiFi#espflash.
When i do that the arduino shows up and works as normal but when i disconnect and reconnect the arduino it shows again as ESP32 Family Device and i need to do all the steps over again to bring it back to normal. I dont know if there is a fix but i will try anything. Also im on windows 11

check that you do not have a connection between the esp download port and the gnd port next to it
https://docs.arduino.cc/tutorials/uno-r4-wifi/cheat-sheet/
at the end of the page it is explained

I also checked with a multimeter, and i have no connection between the esp download and the gnd pin, but i found out that when I disconnect and reconnect the board, it shows as ESP32 Family Device for 5 times, then for 1 time it shows as normal.
and when it shows as ESP32, it says COM5 but when it shows as Uno r4 wifi, it says COM6

yes because on the r4 card there is an esp32 S3 on a COM port different from that of the renesas ra4m1 which is the r4 wifi

have you tried updating your card with that but having the esp32 dowload and the gnd linked ?

Do " Run espflash directly" procedure at Update the connectivity module firmware on UNO R4 WiFi. Make sure that UNO R4 Wifi is the only USB device attached to your computer when you do the procedure.

When you run " Run espflash directly" process successfuly, unplug the USB cable and then replug it to your computer. Then using IDE 2, install the board's Package Core , manually select UNO R4 wifi and the port it is connected to and then "Use the Firmware Updater in Arduino IDE" to update the firmware. If the update goes successfully, unplug the board and then plug it back to program it with the blink LED.

I tried your method and now it works without problems. Thank you so much.