Arduino Zero disappears occasionally

I started programming my MKR Zero the other day and noticed that occasionally the board will disappear from my list of USB devices. The board still receives power, but is not listed in the Port menu or on my machine's /dev devices.

I've tried multiple cables, unplugging and plugging back in, reseting the board, different USB port. Nothing seems to help.

Eventually, after some unpredictable amount of time the board reappears.

I've noticed this tends to happen during Serial operations.

Any ideas?

Try avoid USB 3.0 and stick with 2.0 where possible.

Turn off any additional security just for testing as some software has been seen to cause issues with uploads.

Supply the sketch being used inside code tags ( </> )

What and how are you powering anything (schematic needed)

I am trying to do some stuff with the ADC. I've seen this disappearance with multiple sketches, but here's one specific one: ForceTronics: Utilizing Advanced ADC Capabilities on Arduino’s with the SAMD21 (Zero, MKR1000, etc) Part 1

I've had this happen on two different Macs. Second one was not USB 3. Powered over USB

I've now seen this with all kinds of different sketches. My current remedy is to mash the reset button a few times, cross my fingers, then upload an empty sketch. Sometimes this gets things working. However, certain sketches I have not be able to connect the Serial monitor to.

When this reset approach does work, the board changes ports making it difficult to use the IDE.

Another example sketch I'm unable to get working: Adafruit_ZeroTimer/timers_callback.ino at master · adafruit/Adafruit_ZeroTimer · GitHub

I was able to upload it after some difficulty, but nothing comes out of the Serial monitor, and eventually it reverts to a bad state requiring the above reset procedure.

After looking around this seems to be a common problem. Is the underlying cause known? I'm considering returning my MKRZERO as it is essentially unusable for me :-/

if it is only "certain sketches" then are you 100% sure those sketches are meant for the MKR architecture ?
Done it myself and tried to upload code meant for a completely different board only to be met with an error.

BTW that's an adafruit link, not an ARDUINO one.
Despite the similar names for some boards they are not always the same in reality.

I could not get the examples to compile for a REAL ZERO !