My DS started doing this when he was just over 4yo after sleeping really well previously. We worked out that it was because he needed a wee, he wasn't dry on a night at the time but reliably dry during the day. We started taking him for a wee before we went to bed and that would work until 5am when he would get up. At 5am we would take him to the toilet (if he'd woken) and then put him back to bed but he used to end up wide awake. He's 4.5 now, dry at night and has got the idea that he goes to the toilet and then goes back to sleep again, it's not every morning so it is improving but it was definitely needing the toilet that was waking him up. It was as if the sensation was different in the night and he couldn't really recognise what he needed.