Turns out it also occurs when a site is not “registered” in the Google recaptcha/admin Domains area.
Solution: Add the domain in the recaptcha admin area:
- Sign into your Google account where your recaptcha keys are registered
- Type into Google “google recpatcha admin console”
- Go to your settings for your (production) key
- In “Domains”, add these two entries:
localhost 127.0.0.1
- Save it and test your recaptcha.
I made this error when I switched from a development key to a production key. The production key did not have any entries for localhost.
I configured the API response to sit behind a proxy-redirect. Therefore the verification was working in a localhost environment which was not configured in the Google Admin console which caused this generic error.
Credit to @Christian Žagarskas who pointed it out in his comment.