Perhaps you are going through a bit of PTSD in relation to the accident. You are flashing back to and thinking about the accident and the "What ifs". This could be causing you distress and IMHO would be normal after a close encounter.
When you have PTSD, it can seem like you’ll never get over what happened or feel normal again.
Post-traumatic stress disorder (PTSD) is a disorder that can develop following a traumatic event that threatens your safety or makes you feel helpless.
After a traumatic experience, the mind and the body are in shock. But as you make sense of what happened and process your emotions, you come out of it. With post-traumatic stress disorder (PTSD), however, you remain in psychological shock. Your memory of what happened and your feelings about it are disconnected. In order to move on, it’s important to face and feel your memories and emotions. If you can do this then you can move on and hopefully your depression will lift.
I hope this helps you and I am here to support you.
Gentle Hugs and remember these are just my own thoughts. :)