Hi Adan,
The problem can be caused by:
1/ Different accounts used in XBOX app and Microsoft Store
2/ Not being logged in either XBOX app and/or Microsoft Store
3/ You have other (not official) or older Minecraft launchers already on your PC
4/ A mix of above
The popular belief is that Microsoft tries to get rid of or limit as much as possible the usage of non-official launchers to further prevent cheating.
Your option(s) are:
1/ Update Windows (if there are updates pending)
2/ Delete all other Minecraft launchers
3/ Restart PC
4/ Login with same account to XBOX app and Microsoft store
5/ Install latest official Minecraft launcher
Lastly, if above wont fix, after uninstalling all other MC launchers, you can try the legacy MC installer from their page - see this