How can I switch from ArduinoOTA to ESPhome safely?
I've found that when a flash fails with a space error, I've usually specified the wrong flash size option in Arduino (under Tools->Flash Size).  Depending on the version of Arduino you're using, try picking the one with "No SPIFFS" or FS:none that matches the size of your flash memory.  Once you make that change, recompile and reupload.