

The Xbox app should warn you if you've run out of space, but sometimes it may not.

If Microsoft itself is having issues, that may also cause broken downloads.

Sometimes the Microsoft Store doesn't warn you that you've exceeded your device limit, which may incur problems when trying to download things that require a license. If you have a bunch of old devices you've connected to that you no longer use, you should remove them. The Microsoft Store only allows you to access up to 10 devices at a time with your Microsoft Account. Check that you didn't hit your Windows device limit.
