I know sleepwalking is quite common in young kids (generally they outgrow by preteen years). And it can run in families too.
One of mine would get up and walk around, and still talks in sleep (has conversations) to this day.
It was not caused by emotional issues or stress. The doctors will tell you that most likely. But if you're concerned by that, you can try making bedtime routine more relaxing if needs be.
It usually happens when they are in the deepest part of their sleep which is why they don't wake up and can resist being woken up. So it's better to take them to bathroom, let them go, and take back to bed.
If your son is waking to go to the bathroom (his body telling him he has to go) you can try limiting the drinking 2 hours before bed, having him go once (or twice, some kids don't eliminate it all when they rush going pee), and if you have to, you can wake your child and have him pee when you go to bed. That's what our friend did and it really helped. Eventually they outgrow all this.
I think your doctor told you about the sleep schedule because these kids (who do it regularly) have somewhat disrupted sleep and can get tired during day. My night talker sometimes has bags under his eyes. So you can try putting him to bed a bit earlier if he seems tired.
Good luck :) I'm sure he'll outgrow it.