“Unable to load photo, an error occurred while loading a higher quality version of this photo” error message in Photos (iOS)

I managed to fix it by logging into iCloud.com and downloading the photo from the website (as proposed by @X_841 in the comments).