This is a simple answer, I just saved-signed out and logged back in.
They were in their rooms where they belonged!
gaming.stackexchange.com/users/54820/Praegioin
It happened also to me.
The Guide and the Nurse decided to go hiking for no apparent reason.
The way I made them go into their houses?
Simply put, I paved them the way in.
First I locked them in a cave, then I made a way of little steps for them to come to my house.
That's all.
For me it worked.
gaming.stackexchange.com/users/17620/Duccio Shinichi Mondanelli
I had trouble assigning rooms to NPCs too.
It turned out to be because the house I was attempting to assign them was too close to some Corruption.
Try getting rid of any Ebonstone or vile/corrupt grass you have nearby.
Also note that NPCs won't share a home with each other.
Thirdly note that the NPCs will "teleport" around if you leave the area for awhile and come back.
This may be what you're looking for if you're having trouble leading them somewhere.
gaming.stackexchange.com/users/19997/johnjon
NPCs teleport to their rooms at night when they are outside everyone's view area
gaming.stackexchange.com/users/24409/NanoPi
Go somewhere where you're not gonna see them, like mining, for a half an hour or so and they'll most likely be back in their rooms.
And also try to designate rooms to the NPCs by going into the inventory and on the right side, beside your equipment etc, click on the little house and click on an NPC icon, and clicking on a room
gaming.stackexchange.com/users/11682/Alex
I find that if you build a staircase of wooden platforms at the side of your house, with wooden platforms between each floor, the NPCs just walk up it to their room.
Some may be a bit slow about it, but it always works.
Sorry if I didn't explain it very well however.
gaming.stackexchange.com/users/103583/If_pandas_could_game
The same thing happened with me.
I had to carefully pave a path for him and block the way behind him so he couldn't go back when he went forward .
I made it so he only had to jump up one block at a time.
It takes a while but it works.
gaming.stackexchange.com/users/49464/BeefJerkyBoy16
In Terraria, when a new NPC arrives, I see my friends NPC's to go inside like a charm. For me though, I have walked away from them, gone to the underworld away from them, done every little tip people have given me, but the NPC's NEVER spawn inside my house. I have to manually make a staircase for them to walk inside.Can someone help me?
How do you get NPC's to go inside their houses?
gaming.stackexchange.com
<terraria>
gaming.stackexchange.com/questions/43783
gaming.stackexchange.com/users/15516/Qwertyfizzle
Go somewhere you won't see them for a while and when you come back the NPC should be in there. Make sure the house isn't too close to Corruption.  It seems that the NPCs have a weird pathing. Players found ways to force NPCs to do what they are supposed.
The community offers some details on how to make NPCs go into their rooms.