It’s happened twice now but I am not sure if the panic attacks are related to the stressful events.

Basically a stressful event happens, I’m fine go to sleep, wake up, go about my business all day playing games or whatever and then like 3 - 4 hours before bed I am dealing with a panic attack, can anyone tell me if these panic attacks are related to a stressful event from the day before?