Well, this is of course where we get into the very large differences in our preferred GMing techniques and game selection. When I was running trad 2e games, 25 years ago or so now, then yes I would be heavily considering how the action would shape the trajectory of play, since I was the one in charge of that! I don't want to open up battles that have been hashed out in previous threads, but IMHO that is what ALL trad GMs do. They may cloak it in 'living world' or 'sandbox' or whatever, and play that trajectory more or less loosely, but ALL of them/us think about whether or not the game is going to play OK if NPC A reacts like X to situation N. It just comes with the territory.
As I say, this is why I don't run this sort of game anymore. In the sorts of games that I'm interested in running, the 'PCs get framed and go to jail' thing would be, probably a combination of some GM framing, and playing out consequences of low rolls, or something similar. There is simply no need for the kind of mitigations, nor the 'going off the reservation' type of thing that happened with the OP, it simply isn't something that is possible within the process of play of a game like Dungeon World. The narrative, up to a point, COULD take place, the PCs get framed, sent to jail, maybe get in trouble due to one of them panicking and trying to escape, and then hooking up with a stranger who gets them out. Failure at that last point, well, since it doesn't SEEM interesting, its unlikely to come up. Since these games are based around the characters, who they are, their relationships, contacts, entourage, etc. it would hardly make sense for one or all of them to simply start hacking up random people. I doubt the situation would actually present itself at the table, as scene framing would likely go from "OK, we agree to go with Stranger" to "OK, we're hanging with Stranger and dude is telling us what he wants..." there would be little need to pixel everyone's way through leaving the jail.