Wandering can be a real danger in this situation. A friend’s Mom lives in a senior home that handles patients with dementia and my understanding is the area of the facility she lives in, the outside doors are kept locked.
In my experience, the wandering - or the tendency to wander - occurs in the "mid" stages of this condition, not the early ones.
This is also linked with what the medical professionals term "sun-downing", a tendency to get agitated or very energetic during the hours of darkness, which also tends to happen at the "mid" stages of the condition.
We had nocturnal wandering - several episodes per week - from my mother from - roughly - late 2012 until well into the latter part of 2014, maybe reaching into early 2015.
With one striking exception, - around Christmas - I was abroad at the time and thus missed this drama - she did not attempt to leave the house. She would spring out of bed at around three in the morning, incredibly energetic and sometimes extraordinarily aggressive when one tried to persuade her to return to her bed.
One night, in early 2013, having awakened to not finding my father beside her, she had leapt out of bed (and I mean leapt - I heard the thump of her feet, - normally, by then her gait was tentative, as she had a history of falls - as she planted them solidly on the ground) and proceeded to descend the stairs at a confident trot, roaming the house, checking room after room, looking for my dad. She was calling out plaintively for him, asking worriedly, "Where's Charlie?" and murmuring, sadly, "He's not here..." as she wandered form room to room not having found him. Unfortunately, as he had died eight years earlier, she was not going to be able to find him.
That night is etched indelibly on my mind and memory. I was able to get her to return to bed when she ran out of energy, and I think - at a sub-conscious level - her voice was heavy with sadness - she knew he was gone, but - to my shock - at a conscious level, she had completely forgotten this.
She forgot the names of her children before she forgot the names of her parents - once, a few years ago, I asked her the names of her two sons (my two brothers). "Jack and Jill," she answered promptly, an answer that had us torn between hilarity and heartbreak.
She remembered me for longer, but that is because I was around between periods abroad. These days, I think she thinks I'm her mother, when she remembers anything at all.