We're sorry for the trouble. Please make sure you are connected to the internet and try again. If it still doesn't work, please restart your device and try again.
In rare cases the app still doesn't work properly even after that. If so, follow the steps below to offload and reinstall the app while keeping your data intact.
To do this, open the Settings app, tap "General" → "iPhone Storage", select this app, and tap "Offload App".
This removes the app while keeping its data on your device.
Then find the app on the App Store, reinstall it, and check whether the "Purchase" button works.
Thank you.