The performance of Barcelona under Xavi is not a bad one, leading Barcelona to finish in the second spot in the Laliga table this season, and making them lift the Laliga trophy last season(2022/2023).
I so much believe that, the reason why Xavi is been sacked out of the Barcelona team as head coach, not really about Barcelona's performance so far, but because Xavi intends to leave the team before he decides to stay back to the Barcelona team(reasons best known to him). That action of his might be the reason Barcelona management was pushed to have him sacked to be replaced by Flick, so that the same act will not repeat itself again. Maybe he will go finally and to stay
Barcelona fired Xavi not because of Barcelona's performance this season. Even though there were no significant achievements, Xavi did not carry out his role badly. What caused Xavi to be fired was Laporta's dislike of one of Xavi's statements, in which he said Barcelona would face the next season in the same way as this season, and if nothing changes, then Xavi doubts that Barcelona will win the trophy. I don't know whether the relationship between Xavi and Laporta was no longer harmonious before that case, or if there were other triggers, but it seems that Xavi feels that Laporta does not give him full support, therefore, Xavi once had the desire to leave Barcelona.