Plugging in my board via a USB 2 hub makes the board work and is recognised every time i plug it in.
This was a well known issue with the first USB 3 host implementations with ATmega32u4 and other USB 2 devices that only support USB 1.1 speeds, i.e. 1 Mbit/s (LS) or 12 Mbit/s (FS). I saw this myself with both ATmega32U4 and AT90USB1280.
So i'm thinking it's some sort of USB versioning issue?
USB 3 has separate D+ and D- pins for USB 2.0 and 1.1, and SSRX+, SSRX-, SSTX+, and SSTX- pins for USB 3
and later (with just pin names changing for the type C connector).
The issue is that some USB 3 host chipsets (or possibly drivers) have an issue detecting USB 1.1 devices, i.e. USB 2.0 at 1 Mbit/s (Low Speed) or 12 Mbit/s (Full Speed), and really "prefer" USB 2.0 at 480 Mbit/s (High Speed) or USB 3 or later. I suspect, but have no proof or references, that this is due to the fact that USB 2.0 at 480 Mbit/s requires retiming of the D+ and D- signals to reduce jitter, but not at LS or FS, and somehow the USB 2.0 implementation on these USB 3 host ports fail to correctly detect USB 2 LS or FS devices. (This means that you have the same issue if you use a cheap USB 2.0 LS or HS isolator, like those based on ADUM3160 and 4160, also fixed by using a hub in between the host and isolator.)
When you connect an USB 2.0 hub
that supports HS, 480 Mbit/s –– and basically they all do ––, I suspect the retiming of the signals is what fixes the issue. In all cases of USB 3 and USB LS/FS device issues, an USB 2 hub in between has solved the issue (except for actual broken hardware, that is).
Fortunately, adding the hub in between, has basically no downsides. I personally use a cable one for my USB 2.0 LS/FS microcontrollers, that also happens to act as my USB A to USB micro-B cable, with an el-cheapo eBay $10 ADUM3160 USB isolator between the cable hub and my host computer, whenever I'm poking at pins or breadboarding, mostly to calm my nerves (me being a sausage-fingered uncle bumblefcuk), but also to ensure my host computer USB ports will always be safe and I am in no danger of ground loops or injecting current/voltage back to my computer.
(Now that USB 2.0 HS isolator chips have become affordable (and really only need an additional 24 MHz crystal, and a couple more capacitors compared to the LS/FS chips), I've been thinking about making my own isolator with selectable power lines so that I can use isolated wall warts to supply up to 2A, or host USB 5V via DC-DC converter (drawing max. 500mA from upstream, so typically max. 400mA downstream). My Teensy 4 are USB 2.0, but do support HS, 480 Mbit/s; nice. As these isolators do the retiming of the signals based on the 24 MHz crystal, no hub is needed.)