Back in 1983, we were all anxious to find out what happened to Han Solo after he was frozen in carbonite and taken to Jabba the Hutt. Return of the Jedi wrapped the Star Wars trilogy, beginning with an action sequence where Han is rescued. Luke, Leia, Chewbacca, Lando, and the droids all show up at Jabba's headquarters at around the same time. We get the impression that our rebels had a plan, but no one can figure out what that plan was, since not one step of it worked, or even made sense. Mike Ryan lays out the timeline of what actually occurred. First, Luke gives Jabba the droids. We don't know what he expected to happen. Then Leia shows up.
Disguised as a bounty hunter named Boushh, Leia strolls in and hands over Chewbacca. So already three of our heroes have been captured as part of this, “Let’s just all surrender,” plan. Later that night, Leia unfreezes Han, but as they start to make their getaway, Jabba and all his friends are literally hiding behind a curtain and capture Leia and Han. (I’d watch a whole A Star Wars Story offshoot movie about Jabba planning this curtain surprise. I’d love to see him explain to Weequay, “And then we will all be super quiet and just wait there behind the curtain all night. It’s going to be great. Okay, yes, it might take a few hours, but the payoff will be worth it. We will all laugh.” I also picture Squid Head back there, “Ohhhh, I think I see someone moving. I think this is it!,” and the rest of the gang all shushing him. “Shhhhhh, Squid Head, you’re going to ruin it!”) Okay, so now, including Han, we have five heroes captured.
There are several more steps that appear to have been made up as they went along before our heroes get away. By the time the third movie arrived, I had given up any illusion that Star Wars would follow any sort of logic, so I didn't think about it much at the time. But trying to parse the sequence 35 years later only makes all the kerfuffle about The Last Jedi seem rather silly. Read the analysis of Han's rescue operation at Uproxx.
The point is that things did go south and they never get out of the Palace. The original plan, whatever it was, is toast. Everything Luke does after that is just him making things up as he goes along because the plan is already blown.