Birds, especially cockatiels, cockatoos and macaws, will often panic if awakened suddenly from a sound sleep. A loud noise, vibration, sudden movement or other cause most likely put the bird into "escape from danger" mode. This natural reaction is not something that can be trained out of a bird.
It's possible your bird will be injured when she is having a night fright reaction. Her immediate response of flight may cause her to slam into the cage, fall from her perch or thrash around violently. She might end up with pulled feathers, shock, internal injuries, or bruises to her wing tips, feet, chest or abdomen.
If your bird is often plagued by night fright, you need to take measures to decrease the instances of occurrence. Place a small night light near her cage so she is able to see when startled awake. White noise will help cover nighttime sounds; use an air purifier, rather than a fan (which causes drafts).
To keep injuries at a minimum, make sure the cage is toy-free at night. A separate, small cage may be used for sleep. Place a towel on the bottom and lower sides of her cage to cushion her when she falls or thrashes about.
Be aware that seizures are often mistaken for night fright, and may be an indication of a life-threatening illness. A seizure consists of intense, uncontrolled muscle spasms. The thrashing is similar to a fright reaction. After the seizure has ended, your bird will look dazed and extremely tired. You need to immediately treat any injuries, keep her quiet, keep her cage covered and take her to her avian veterinarian.