Here is my theory (could be wrong in some points but think there is some truth there at least).
1. Xavi wanted to offload Lewy (amongst other players) in summer and admited his plans to Laporta when they were still on good terms.
2. Laporta surely knew this was almost impossible given the contract he has given to Lewy (why would he go to SA when he can earn almost same money here?) but probably still asked Pini Zahavi about a possibility of Lewy leaving. And I assume his response was something like "Lewy will play out his contract and there is nothing you can do about that. Xavi doesn't know how to use him but hey, my friend, I have a coach who can get 40 goals out of him again". Just food for thought for Laporta at that moment but...
3. Then that loss against Girona and famous Xavi's presser few days later (which I believe to be a trigger but not the most important reason why he was sacked) happened and hot-headed Laporta started to think about Pini's proposal. He admitedly liked German coaches but I think he would prefer both Nagelsmann and Tuchel over Flick. He was too late for Nagelsmann who decided to renew with Germany (could probably get him if Laporta wouldn't wait on Xavi though) and he knew Tuchel wouldn't be a yes man for him. And after Xavi was given too much power I think that's what Laporta wants now.
4. Laporta (via his brother in-law) leaked list of the players Xavi supposedly wanted to offload including Lewy which ruined relationship between those players and Xavi and made it impossible for him to continue. Obviously at that time Laporta already decided Xavi is gone.
So our beloved president is not only someone who makes important longterm decisions based on his emotional state which can change every day but what's even more worrying is I think he's highly influenced by agents like Zahavi and Mendes who are smart enough to get close to him. Maybe they pay him a good dinner and he'll do what they want, lol.