Cats are at their most vulnerable when they’re sleeping, so getting spooked while sleeping will have a lasting effect.
You may or may not have noticed what spooked them.
It could have been a loud noise, another pet pouncing on them, or maybe you kicked them in your sleep (see the first point above).