Is the problem occurring in the Microsoft Store or only in the Xbox app?
Try to repair using the Gaming Repair Tool:
https://aka.ms/GamingRepairTool
The link above is direct download, if you prefer, you can download through this article;
https://support.xbox.com/help/games-apps/troubleshooting/gaming-services-repair-tool