sounds a lot like a memory controller failure. Had the same problem on my Desire S after mistakenly pulling battery out and reinserting it immediately, it fried the controller of the eMMC and afterwards it was damn near impossible to flash anything over it. It would work, but all would be gone upon the next reboot (even apps installed via the market or user settings), it was as if the device was frozen in time...
As it is related to a hardware fault (crappy memory chips), I'd ask for replacement anyway. If you're located in Europe or the USA there are laws that force manufacturers to honor warranty in case of a a design or hardware flaw, look it up on google to have some leverage on them.