Option 1: Retcon It
Given the situation of a player basically going off the rails and sabotaging the campaign, the simplest solution would be to use a retcon. Wipe out the events of the last session entirely. They didn't happen. Write out the now missing player, and life goes on.
Retcons are often lousy answers in themselves, but in a case like this you'd likely get support from the rest of the players.
Option 2: Roll With It
You don't want to wipe out the party for this, but if you also don't want to retcon it away, you can maybe turn it into something useful.
Based on what you described, Bob is guilty of most of the actual offenses (including the worst ones). You could have an advisor to the King look into it, interrogate the party, and come to the conclusion that they did not actually push Bob into anything. They also didn't pick fights with the slaves. They did try to escape, but that in itself doesn't have to be a capital offense.
Maybe someone in authority sees a use for these adventurers, and given the situation decides to offer a deal: "Do something for me, and I'll see to it that your case is re-examined."
That something could be anything. A side quest you want to run, a service to the kingdom against some marauding evil things, a quest to retrieve some item that the powerful figure needs to overthrow the King... whatever.
Adventurers are a resource, and those with power now have a bunch of adventurers in the PCs sitting in a cell awaiting execution that could be put to better use. If they accomplish the task, reduce the sentence to a public flogging given the mitigating situation and their "service to the crown" in whatever task they were given. They'd be very cheap and expendable labour, because it won't cost the authority figure anything to hire them, and if they die he's lost nothing. (Mercenaries are expensive, and replacing your own people if they die on a hazardous task is annoying.)
That lets you carry on the game while giving the other PCs a chance to work their way out of the situation. They could still be executed if they screw it up, but it's in their hands how they choose to act.
Option 3: Use Bob
As several commenters mentioned - Bob's player is gone. You can use Bob in any number of ways.
- Maybe he makes a heroic sacrifice to let the party escape.
- Maybe Bob was actually working for the authorities all along and his goal was to get the PCs in trouble so they could be attacked or used by the authorities, with a plausible cover story.
- Maybe Bob was working for the evil guy in your campaign, and wanted to stop the PCs from being a potential issue by getting them in trouble with the authorities.
These all have the common theme of Bob not really being what he looked like initially. Now that you're in control of him, you can use him to fix the story plausibly.
Option 4: Heroic Luck/Deus Ex Machina
Also from the comments, you can have a lucky catastrophic event happen that creates enough chaos for the PCs to escape, or go save someone important and earn some redemption. This stretches plausibility more than some of the less obvious plot options presented above, but is still following the story and thus isn't as drastic as a retcon.
In my experience this type of thing can work in a campaign, once. If you rely on it too much the PCs start to see it as a trope that events will conspire to save them, and it loses its impact. So it's best to try and save it and use it at a properly dramatic time, or if you really have no better options.