STM32L4 USB CDC Interrupt Priority Failure (vPortRaiseBASEPRI)

This looks highly suspicious. And combined with the fact that your symptom is intermittent, I think you may have some memory corruption (bad pointer, stack overflow, etc).

What MCU are you using?