Hello,
It sounds like the Microsoft store on your pc might be having issues, first try to run wsreset to refresh the Microsoft store app.
Press windows key + R, then type wsreset.exe, check your time and date since if it’s not the correct time according to your timezone some functions won’t work, afterwards restart the computer.
Open this link for a more in depth guide.
Microsoft Store doesn't open - Microsoft Support
If resetting the store doesn’t work you can also try to make your purchase by accessing the Microsoft store through a web browser.
Hope this helps,
JC