Just read in a book about panic about this very topic. I have midnight panic attacks all the time and they are horrible. I find that cuz I'm half asleep, it takes me longer to think rationally and therefore calm down.
The statistic quoted in my book that 50% of people who suffer from panic disorder have nocturnal panic attacks and 25% have repeated nocturnal panic attacks.
The reason for this is that the fear of physical symptoms can occur automatically over time with panic disorder. Over time the panic response to physical feelings become so automatic that we aren't aware of thinking but they still influence feelings and behaviours. This is why panic attacks can happen in deep sleep.
Apparently, We still have the capacity to respond to meaningful events in our sleep e.g. a mother of a new born child may wake at her babies cry but sleep through a number of other loud noises. It is normal to have changes in physical rhythms during sleep e.g. changes in breathing or heart rate at different times throughout night. However, If the physical changes are frightening to us during the day it is understandable that they can cause the same reaction at night.
I think the key is when you learn to accept/become less fearful of physical symptoms during the day, the automatic nocturnal panic attack to the same physical response at night will disappear or at least become less frequent.
I hope this helps! (and makes sense)