I followed your process (thanks for the NXP MCU Boot Utility instructions. I had used it yesterday to erase the NOR--I think--but was baffled by its iconoclastic UI, lol). As with your experience, flashing the hello_world demo via the Boot Utility did not rescue the board (though the demo ran fine).
I hadn't build the wifi demos into my SDK, so I built a demo that I had previously run via the OpenDAP debugger, the bubble_peripheral, and flashed it with the Boot Utility. That seems to have reconfigured whatever was broken in the first place.
Then I got a debugging protocol error popup (Failed to read memory--don't recall more details), and the board re-entered the same broken state. Using the MCU Boot Utility with that same project fixed it again. Urgh.
I then debugged the demo app that I was playing with when the debugging link broke, adc_12b1msps_sar_interrupt, and that worked fine. I the went back to the bubble_peripheral and it also worked fine, now I'm back to the adc_12b1msps_sar_interrupt and it's running fine.
No IDE debugging protocol error popups thus far.
My best guess based on these behaviors is that there's some sort of race condition when debugging that causes the RT1040's SWD interface to get confused, and the first sign in this morning's case was the memory read error. No idea why it stays confused, but I'm really glad @dayson found the general process to rescue the board.
More news as it happens.
We (me, @dayson, @expertsleepers, and anyone else who experiences this) should all open trouble tickets on this board--I think there is a defect in the processor or board support package (perhaps the suspected race condition, or a stray stale pointer) that triggers this.