In fiction (and in real life), when people (especially kids) get nightmares, they’ll run to their parents/siblings’ room/bed for comfort. Some people would scream and it’d be the other way around, the parents/siblings running to the person’s room, but I’m not talking about those people.
If you really think about it, isn’t it scarier to leave the bed than curl up in it after a nightmare? You’ve just dreamed of some nasty stuff, now you’re going to leave your room and walk in darkness alone for however long it takes to reach someone else’s room (imagine if you’re living in a huge mansion and your parents’ room is on a different floor). That takes guts.