Yeah, that is probably a good point. Actually the GPIOD and AFIO clocks are already up and running from previous peripherals and I should of removed the AFIO clock init function call. The CAN clock is enabled before any access to the CAN peripherals registers.
Anyways, that doesn't really answer my questions about the interrupts as in practice all clocks are up and running and I did retry it after moving the CAN clock init to earlier and the same thing still happens...
I don't like the order you initialize things, the clocks to the peripherals, including GPIOD, need to be up and running before you prod the hardware. It is after all synchronous.