Basically Barcelona have been wrong from the start when choosing Koeman as coach, so if at that time sack him sooner and make Xavi as coach at least it can make Barcelona recover faster. Because Koeman's dismissal was very late, it was too late for Barcelona to bounce back, because now we know the good results after Xavi became coach, so we can assume that if Xavi became a coach sooner, Barcelona would be quicker to recover.
If xavi was to be the coach to Barcelona beginning of when the started Barcelona would have been dragging position with Real Madrid and they would have been a big threat to Real madrid. As it stands now next season Barcelona will be the only team in laliga that can confront Real Madrid.
Better a little late than never. It may be true that Barcelona were wrong in appointing a coach, but they managed to correct that by appointing Xavi as Koeman's replacement. This was not what they expected, where Koeman instead made this club a mess and had to be eliminated from the Champions League zone before Xavi arrived.
I think it's natural for Barcelona to choose the wrong coach, because other big teams often choose the wrong coach. The most important thing now is
that Barcelona already has Xavi as a coach, and it is proven that Xavi can lift Barcelona's performance for the better. So as you said it is better late to
make Xavi a coach than never. Actually Ronald Koeman is not a bad coach, it is proven that he has won many trophies while coaching in the Eredivisie.
Even when he was coach of Southampton, Koeman was awarded the EPL best manager 3 times. But it seems that Koeman is not suitable to
coach Barcelona, maybe Koeman will be successful if he becomes a coach in the Eredivisie again.