Sorry to hear about this . . .I've had something similar and it is scary without a doubt . . . now, I am not a med professional so this is just something that I learned about me which may or may not help . . .
Whenever I go to bed worried, I usually have these panic attacks at night . . .it is as if my brain does not go into sleep mode so it has free landscape to go about and trigger anxiety which is then with me when I wake up . . . .so, for me, there is always a trigger of some type that I need to deal with before I can go on . . . if I don't resolve the issue then what happens is I become overtired which increases the anxiety, etc. You get the picture . . . .
So, I would say that you need to check things out with a doc (in a couple of my cases, a thyroid issue was actually at fault that triggered the anxiety) and speak with a counselor to figure out what might be at the root of things . . . . but, yes, indeed, it is possible to have anxiety and panic attacks in your sleep . . . as to the why, well, that is something you need to figure out . . . .has anything been bothering you at home or work? doesn't have to be big to be a trigger? are you taking meds that might be have a counterproductive effect which can happen for some meds and some people? The best thing I can tell you to do is to get checked out and start exploring why this may be happening now . . . but it is not unusual but it is pretty damn ugly when it happens . . .please let us know how you are doing and I am sure others will have more insight than I do . . . . take care, kc