Upload fails specifically every second time - Teensy 4.1

Everything is up to date. I made a blink sketch, that worked fine every time. Then I added NativeEthernet, still worked every time… then I added NativeEthernetUdp - that did it. Failed every other time, same as before. Here’s my code if you want to try and replicate it (obviously must be on a Teensy 4.1 with ethernet):

#include <Arduino.h>
#include <NativeEthernet.h>
#include <NativeEthernetUdp.h>

EthernetUDP udp;

uint8_t mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xC2, 0xAA };
IPAddress ip(192,168,30,27);

uint32_t timerObject;
bool flipFlop;

void setup() {
pinMode(13,OUTPUT);

Ethernet.begin(mac,ip);
udp.begin(1000);

} // END SETUP

void loop() {

if (timerObject<millis()) {
timerObject = millis() + 1000;
flipFlop = !flipFlop;
digitalWrite(13,flipFlop);
}

} // END LOOP