fdMonitor only works sporadically

I created this standalone solution which either monitors the UART via fdMonitor or in a while loop, depending on the USE_MONITOR switch. Both result in the same behaviour as descriped originally. To me it seems like sometimes the device is not ready at startup because if the UART app is started automatically it never works. If it’s started manually immediately it also doesn’t work but if it’s started after a while it works.
UART-Test.zip (6.8 MB)