I don't think it will work, looks like messi will still have one more season to go before he actually retires. if barcelona are planning to facilitate messi's return to camp nou, just to become a club ambassador, or as you say as the new coach of barcelona.
I assume that won't happen. if the scenario is as you say, in other words Xavi will be replaced. Isn't it Xavi who wants Messi to return to Camp Nou, there are a lot of rumors going around. but for sure, messi still has a chance if he still wants to play one more season with PSG. PSG have the option to extend Messi's contract for another year.
With Messi contribution at PSG clearly having a big impact, it is possible that his contract will be extended. It is not difficult for a PSG manager who has a lot of money on the condition that Messi can strengthen PSG's front position again. I know PSG still has Neymar and Mbappe will continue. Messi's help up front shows that PSG needs him in the long term. It will still happen if the other options i.e. Messi are not extended, the advantage is at Barcelona and what Xavi hopes to happen is Messi's return to the atmosphere of El Barca.
Of course PSG will not let Messi go just like that, PSG will do whatever it takes to make Messi stay in Paris. But the final decision lies with Messi, he could return to Barcelona when his contract with PSG has expired.
Messi, who is one of Barcelona living legends, still loves the club that has made his name, especially now that Barcelona is being controlled by one of his closest friends. Xavi has asked Messi to help him rebuild Barcelona's strength, this request is very difficult to refuse because Messi and Xavi relationship is like family.