This information comes from Cracked
In early drafts of the second installment of the Star Wars saga, Boba Fett and Darth Vader weren’t supposed to get the upper hand on Han Solo. Han was supposed to fly off with Chewie in the Millennium Falcon to fight another day. That would have set up a very different first act for the saga’s third installment, but there was a complication: Though Mark Hamill and Carrie Fisher both signed up for two more films after Star Wars became a hit, Harrison Ford wasn’t sure he wanted to commit to that much Han Solo.
See, Ford wasn’t all that impressed by Han as a character. As recently as 2010, he was wishing the character had died (though it seems he’s changed his tune now), and back when Empire was being made, he still wasn’t sure if he could stomach a third time out in Han’s boots. Not wanting to kill the character outright, George Lucas and screenwriters Leigh Brackett and Lawrence Kasdan had instead to find a way to sort of press pause with the character, giving them both a way to dispose of him and a way to revive him if Ford decided to sign on for another film. So Han was literally frozen, and if Ford had decided he just wanted to go make more Indiana Jones movies and drop the character that had made him a star, Han would’ve just been stuck on Jabba’s wall forever.
Of course, Ford did sign up for Return of the Jedi after all, and the carbonite freezing just wound up being a sort of detour for Han Solo. We also got that great freezing scene out of the whole affair, featuring the “I love you” / “I know” exchange between Leia and Han that wound up being a defining moment for both characters. It’s hard to imagine now that we could’ve gotten a Return of the Jedi without Han Solo, but maybe in a parallel universe somewhere they’re watching a version right now where Lando hooks up with Leia.