I did outgrow nightmares as I got older but I don’t think it has to do with wisdom but rather lack of control. As a child you also are more prone to being imaginative. People tend to lose their imagination as they get old. Not everyone I’m sure. Just the same as not everyone feels more in control of their life as they get older.
As @Darth_Algar already pointed out you can get wiser and actually get more nightmares. You have more responsibilities as you age and become more aware of pit falls of life and may have more worries.
For instance. I remember some years back having nightmares of all my teeth falling out. My dentist said I had gingivitis despite the fact that I brushed my teeth quite regularly and flossed. It seemed that all my effort was for nothing. So I felt helpless and it came out in my dreams. I knew it didn’t mean my teeth were all going to drop out but at the time it really bothered me. The more obsessed I became about brushing the worse my dreams became, till I found something that worked to reduce my gingivitis.
As a kid, I use to have lots of nightmares of death and I remember one even where my whole family died except for me.
I was sick a lot as a kid and even though my parents never said anything to me about dying I’m sure I sensed their fear. And then there was also that my father was very ill and I knew there was worry about him as well. I’ve may of heard that his illness was a death sentence or sensed it. I know I was about maybe 5 when my dad was in the hospital and I went and told my mom that the man said not to worry about dad because he wasn’t going to die. She said she made sure not to say anything to me and my dad was in the hospital and I believe she only told me he would be gone for a few days. She asked me what man, and I told her he just left and he was a very nice man.
Anyway. I think this confirmed for me that there was something to worry about. Although I do remember some of it and the odd calm I felt, I remember the nightmares I had before that. They stopped for a while but came back whenever my dad would have a bout.
So my point is that wisdom does not delete fear. Most nightmares come from fear or sometimes illness or just bad food. However, understanding nightmares and where they come from can sometimes diminish nightmares if they are based on fear or guilt. Once I started to understand where some of my nightmares came from I was able to get less of them. I’m do not have a Phd in dreams but I in my own personal experience my nightmares became easier to manage once I learn to control my fears and not be afraid of the things I couldn’t control.
Most of my nightmares (which are rare now) now are usually linked to bad food or sleeping wrong (like sleeping on my arm till I lose circulation) or acid reflux or a stuffy nose.