Ok. But the players probably don't know what combat spells the NPC caster has either. So are you fine with adding new spells to the NPC in mid combat?
Why not?
Granted, IMO, it's less likely, simply because the DM is too busy to add stuff in the middle of combat. Or, at least, I know that I am. There's is zero chance I'm going to start futzing with adding more spells to the monster in the middle of combat. I want less already. Like I said, 5 is a good number. If the caster can do 5 different things? Yeah, I'm good. Anything more than that is, again, purely for me, pointless. I'm not going to use those extra options.
Now, the compromise here is that we're getting about a dozen different actions for the creature as opposed to two dozen or more. So, at least they're cutting stuff in half to make it easier on the DM to run - something people have been asking for for rather a long time. And, since this mostly applies to higher level games, where things are already very hard to run, anything that makes it simpler is a good thing. Again, IMO.
One of the most consistent complaints in D&D since early 3e days is that the high level game is too hard to run and there's no material for it. Well, if they actually want to address that, this is a good start.
But, to roll back to your question, again, why not? Why should't I switch out a spell or just add one in the middle of combat? The player's won't know, and the combat block is not supposed to be the entirety of the character. Can't be considering that a stat block, even an lengthy one, is still very truncated compared to a PC sheet. That Deathlock MasterMind has to be at least a 9th level Warlock to have 2 5th level spell slots - yet has no invocations. The Mastermind could easily have more spells than what's on his list. So, poof, instant Invocation and now he drops Conjure Elemental, or Confusion or Polymorph, or turns invisible multiple times.
Justifying something after the fact, despite it not being in the stat block is DMing 101.