Definitely sleepwalking. My daughter was guilty of this, and eventually outgrew it. I left her asleep on the couch, went to pee, and while I was washing my hands, I heard the front door unlock (I live in a condo and back then, in that unit, the lock would automatically turn if you pushed down on the door handle to open it), and I heard her scream out into the hallway for me. It was past midnight, and luckily, none of the neighbors noticed. I turned her around, heard her snore while walking, and put her in bed. I also woke up once to her standing next to me and saying "don't want to go to school, don't want to go to school" on a weekend morning, her eyes were open, when I touched her and said "today is Saturday" she had a look of panic on her face and screamed, suddenly awoken. That is when I realized it was sleepwalking. Her cousin did that too, walked from one of the house to the family room, crashed on the couch, then woke up in a fright when he realized he wasn't in his own room. He forgot his mother had driven him to his grandparents and for a second, he didn't realize where he was. They both outgrew this.
I think it is pretty immature and jerk-like of your husband to share this intimate information about his child with friends so they can mock him and constantly bring it up. Would he like it if your son found Viagra pills and he told his friends your husband had sexual dysfunction issues? To me, it's pretty much comparable to mocking a grown child about bathroom issues, as if he is regressing to being a baby who cannot control his bowels. Sleepwalking doesn't make anyone a bad kid. How awful to tease him for this and call him such names, for something that isn't even his fault and he is unaware of. I suggest you tell your husband to tell his friends to knock it off, mocking a child is repulsive, and your husband could benefit from some family therapy to learn how to treat his child and how to approach him about psychological or medical issues, because if this is how he does it, he could very well end up with a very troubled, angry son ready to lash out. He needs to grow up as do the so-called friends. Time to divorce the friends (more like bullies), if they refuse to stop.