The title program is test code originally put on a atmaga32u4 by a TWI bootloader.
I also have JTAG access.
The code just pats its external watchdog and uses Arduino to write to its USB port.
After being bootloaded, the code did not run.
Avrdude and JTAG tell me the code got there.
Sometimes the code runs and I can read from the port
and see the port in the Windows 10 device manager.
As a test, I set the high fuse to 0x91: boot to app.
I have not changed it since.
It ran, that time.
Power-cycling reliably stops the code.
Sometimes reading the fuses will start the code.
Sometimes setting the high fuse to 0x91 (Edit: from 0x91) will start the code.
Doing both will *almost* always start the code.
As an experiment, I tried power-cycling without the Atmel-ICE attached.
I'm at a loss for things to look for.