I used to wake up grasping for breath almost every morning while I was taking Klonopin daily. It stopped once I quit taking it. I took flexiril too for few weeks and don't remember it was causing it. Xanax never caused it.
Now I get that feeling rarely when I get too tired, stressed, dizzy, headachy, pain etc., Did sleep study too but that time It didn't show up. Duh!
I wake up disoriented, panicked and feel terrible. Bad feeling.
If u r getting it consistently sleep study can be very helpful. They do look for lot of stuff.

. Only tricky thing you should be able to sleep with wires attached to u r head and all. I was able to get some sleep but I still think something goes wrong in my neck or back of my head when I sleep.
Cheers!