That's how my first panic attack happened, recently rolled. Smoked a lot and lost my shit, seen a few friends with the same occurrence.
Welcome to the world of pot induced panic attacks. Even though the MDMA was out of your system by then it still left it's mark on your brain. Your brain doesn't go back to normal for a long time after a roll regardless what anyone here will tell you . MDMA leaves your brain in a mode of high stress , add that to high doses of marijuana and you get a panic/anxiety attack.
I am almost certain if you hadn't rolled 4 days prior you wouldn't have run into that panic attack as you are probably experienced with THC i take it.