Hi Ronaldo
So this worked for me...
In Arduino IDE 'Tools' set 'Flash Size' to 16MB & 'Erase All Flash Before Sketch Upload' to Enabled... all other settings as default.
After compiling Output shows 'Connecting....' which hangs for ages (I assume it's erasing the Flash) but after upload the Core2 runs the sketch.
I subsequently disabled 'Erase All Flash...' but kept 'Flash Size' at 16MB... and a different sketch also ran after upload.
If I changed 'Flash Size' back to the default 4MB the sketch uploaded without issue - but the Core2 wouldn't' run it - so same issue as before.
If you compare the output from M5Burner and Arduino IDE there are differences - the version of esptool.py for one... but also the Flash locations that get erased on a new upload.
So I reckon you're right - it seems like the Flash at the locations the Arduino IDE uses has been damaged and that's what's causing the problem.
Anyways, hope this works for you too - let me know how you get on.
Best
Lewis