Why do adults have anxiety dreams about school long after graduation?

My recurring college nightmare is when I realize in the middle of the semester that I'd signed up for a class that I'd forgotten about. That day, I have a test to take, and I'm unprepared. I scramble to try to figure out the material and study for the final, but it's all a jumble in my head, and I can't focus. I realize I'm going to fail the class and my whole academic career is going to be ruined. When I wake up, it's a great relief to know that it was just a dream.

According to Kelly Conaboy's article in The Atlantic, school anxiety dreams are common among adults who are long out of school. She spoke to a Harvard dream researcher to find out why:

Deirdre Barrett, a dream researcher at Harvard University and the author of Pandemic Dreams and The Committee of Sleep, confirmed my suspicion. She rattled off a few common school-dream variations: The dreamer has to rush to an exam after having overslept, or they can't find their classroom, or they prepared for an exam by studying the wrong subject, or they sit down for an exam and the text is in hieroglyphics, or they show up to school nude. "It's a really common theme," she told me. "And it's common not only for people who are still in school … It's a very common theme for people who are far into adulthood, who have been out of school forever."

Barrett explained that these dreams tend to pop up when the dreamer is anxious in waking life,  particularly about being evaluated by an authority figure. She's found that people who wanted to act or play music at an early age tend to experience anxiety dreams not about school, but about auditions—in their youth, that was where they interacted with the authority figures who could most easily crush them. In each of these dream scenarios, we revisit the space where we first experienced success or failure based on our performance.