Whether it ends in a TPK isn't relevant. If you're playing capture the flag and your opponent reveals they can just teleport your flag to their base it'll have roughly the same effect. If the GM can just say "you lose now" it'll seriously demotivate anyone who is trying to enjoy the game, for whatever reason.
Overall, the difference between having an in-character "please stop being murderhobos" moment and having an out-of-character "please stop being murderhobos" moment comes down to how likely it is for the players to take the message to heart. If it's just some dude that's telling them to stop being murderhobos and is an unwinnable fight if the players refuse, that sets a distinctly different tone than the GM pausing things for a moment to explain the current situation to the players.
Both can work, but keeping it as a narrative element has a higher chance of failure, since it's possible the players could interpret this as just another NPC encounter instead of the GM's thinly veiled wishes for the future of the table.
Overall, the only people who care about the story are the people at the table, and having a moment of jarring change in the characters to set the narrative back on track is fine. You'd probably want to do something like that anyway to paper over the past behavior, otherwise the players could listen to you and be understanding of what you want, and still get punished for the stuff they've already done.
It's just an analogy. Here; let me try one more time.
If you're playing a horde shooter and your friend reveals they can just spawn a boss on top of you at any time, it kind of kills your desire to keep playing - at least with them.
No offense, but you seem overly fixated on all the wrong things.