@Japio I think I've seen the esp start some wifi stuff in parallel to the arduino startup code. Could be that if the gateway setup is delayed the wifi will not start as expected.
You could use a timer, initialized from before() to cycle the leds during startup.
Just wondering, do you call some form of yield() during the led setup?