These are mere warnings. It’s not the reason why “recaptchav2” won’t work.
Do you get the recaptcha_error_message (“Please select the checkbox in the ReCaptcha image.”) or no visual feedback at all?
Maybe you could try debugging what happens when the hook is processed.
In the snippet “recaptchav2”, if the verification isn’t successful, the code just logs the information with the log level debug (modX::LOG_LEVEL_DEBUG) which usually isn’t visible in the MODX error log file.
Maybe change the line in the snippet (NOT in the file on the server) to use modX::LOG_LEVEL_ERROR instead, to see the return from the Google API. (Or alternatively temporarily change the system setting log_level).