Hey, so it looks like you've already got some ideas on this, but since this is something I recently implemented as well, I thought I'd share my experience on it. Hopefully it's helpful and gives you some more ideas on the matter
First, my NPC behaviors work like this: at 8pm, NPCs will walk home/to the inn/to the tavern. Houses are locked at this time, and the player is asked to leave (aka kicked out) NPC homes. This doesn't apply to anything quest related; those are always available unless the quest itself is time-sensitive. Player cannot enter NPC homes past 8pm, as doors as locked until the morning when NPC leave and return to their places in towns and their usual patterns.
If the player enters the town past 9pm, I assume every NPC has already walked home. Same in the morning; there's a small allowance window, before I assume everyone has already woken up and gone where they need to be. Otherwise player can get town at 3am and see everyone
just then heading home, which I feel is strange
I do all this using Yanfly Move Route Core and Save Event Location. Along with my time system, which I modded to control the switches I need based on time of day. I make use of NPC self switches, so they say different things while moving (ex: if Amy is going to bed, she might say 'excuse me, I'm going home' while walking instead of 'welcome to Starter Town TM*' that she would say in the day)
Now, some things I learnt while making all this: first, as pointed out, you cannot just turn a switch on and off. You will have NPCs teleporting, appearing from thin air, or disappearing into the void. I mean, you can, but if your goal is to make an immersive world, it's gonna look strange.
Second, you cannot actually move maps with an NPC. RM isn't good for that by default. But that's okay! We just need to make it LOOK like the NPC moved maps, which is possible by creating two events of the same person on two different maps.
Third, and this was an awkward one, albeit specific to the way I set up my system. If the player enters the town at 8:58 pm, the NPC start to walk home. Remember, if it's past 9pm, I assume everyone has already gone home. So at 9pm, the NPC switch to their 'already walked home' event, and just vanish. I had to manipulate self switches so NPCs that are walking...don't disappear. Even if it becomes past 9pm. And same goes for morning routes.
It's tricky eventing to start, for sure. Lots of logic had to go into which event page goes in which order, to preserve necessary priority.
This is 100% possible though. Is it perfect? Is it is as sophisticated as some game titles out there? Nope. But, I'm a rookie coder making an indie game, and I'm pretty proud of this functioning lil system, and I'm still expanding it. I'm sure some of the experienced coders in the community made better systems (I know there's an NPC scheduler for MZ, complete with weather and time conditions)
It's very time-consuming, however. Just make sure this is what you want to do before you start

I'm happy to share notes if you wanna go down this route.