Multiple MKRZERO boards suddenly quit accepting uploads.

I've been working with a circuit all night that was stable, working well, doing everything it should. I hadn't changed anything at all in hours, but I'd done a number of uploads to test software changes. I go to do an upload and suddenly the arduino IDE was telling me I have to update boards and libraries... and the upload I started never finished.

It turns out that I'd uploaded a sketch with a divide-by-zero in it, but for some reason, all hell has broken loose since then. I cannot upload to either of my boards unless it is in bootloader mode. As soon as the upload is done, it drops back to normal mode. I have to switch the port to the non-bootloader com port to connect the serial monitor. If I have the Serial Monitor connected, I have to first close the monitor before I switch to the bootloader or the upload may fail. For the description below, I'm using boards with nothing connected (sitting in an otherwise empty breadboard) and the following code:

void setup() {
int count = 0;

void loop() {
digitalWrite(LED_BUILTIN, HIGH); 
digitalWrite(LED_BUILTIN, LOW); 

Both boards show up in the Port menu (as "(COM 4) Arduino MKRZERO" and "(COM 6) Arduino MKRZERO"), and both will show bootloaders when the reset button is double-tapped (as "(COM5) Arduino MKRZERO" and "(COM7) Arduino MKRZERO"). The bootloader versions show as "Arduino MKRZERO bootloader (COM5/7)" in the Device Manager.

After doing a bunch of cycles back and forth, when the board is in default mode, I have about 15 instances of "(COM 4) Arduino MKRZERO" - all of which are checked - under the Port menu, and one instance of "COM 5". When the board is in the bootloader, it shows 15 instances of "COM 4" and

When I connect either board, I get the notification sound from Windows that indicates that hardware has been attached. Single-pressing the reset button gives me the "hardware disconnected" sound, followed by "hardware connected", but double-pressing the reset button on the board gives me the "hardware disconnected" sound and no "connected" sound. This is despite the fact that the device manager updates to show that the default board has disappeared and the bootloader version has connected.

My understanding is that the bootloader is supposed to disappear after 10 seconds to be replaced by the default configuration. However, the Device Manager will show the bootloader until the device is reset or disconnected.

I've uninstalled and reinstalled the driver in Device Manager, and I've uninstalled/reinstalled the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" module in the Boards Manager in the Arduino IDE. I've also tried an older version of the board module.

I've had issues with one of the USB ports on this machine, before, so I tried them all. They all behave the same way. I have no problems uploading to a Metro Mini I have lying around.

Trying to upload a sketch while the board was in the bootloader worked once, and I was then able to upload when the board wasn't in bootloader mode, but the first time I tried doing an upload while the serial monitor was open, I was straight back to where I started. I cannot upload a sketch without putting the board in bootloader mode first.

I should probably add that, when I try to upload to COM4, I get the disconnect sound from Windows, and the Device Manager almost immediately updates to show "Arduino MKRZERO bootloader (COM5)" and the upload then fails ("Error opening serial port 'COM4'.")

What gives?