The "upgrade failed" message usually signifies a temporary App Store glitch and the purchase completes successfully when trying at a later time (or after the restart of the device).
Additional steps:
A suggested solution that could fix this is to logout and re-login on the App Store:
1. Open the App Store on your device
2. Click on your profile picture or the profile icon at the top right corner of the screen
3. Scroll all the way down to the bottom of the screen and press on the sign out button
5. Restart your device
6. Once restarted, sign back into your account following the same process
If that doesn't work please confirm your payment settings on the App Store.
This article from Apple's Support will guide you through the process.
https://support.apple.com/en-us/HT201266
If you are still experiencing any problems, please contact our support team.