Update:
Since I had to reinstall the firmware, updated RRF 2.05.1 to 3.1.1, the problem persisted. So, during one of the errors I read something about an SD card error, now I don't remember it anymore, so I used the original SD that came with the Duet 2 Wifi and the problem didn't occur anymore. I will soon try to format the card as previously indicated.
Anyway, I believe it was a problem with the SD card, thanks.