I think your script is finishing before the recaptcha has generated the new value.
One solution might be to put that last check in a setTimeout.
Also, you still had reference to a different form (homepage-contact) so you may need to change those too:
var lastval = $(".g-recaptcha-response-v3-recaptcha_test").val();
grecaptcha.execute('6Ld5QIoUAAAAAKznGOlK7z6mgqJ8ajRUc3CK5M17', { action: 'general_form_recaptcha_test'}).then(function(token)
{document.querySelector('.g-recaptcha-response-v3-recaptcha_test').value = token;});
setTimeout(function(){
var thisval = $(".g-recaptcha-response-v3-recaptcha_test").val();
if(thisval == lastval) {
alert("Recaptcha input field value did not change.");
};
}, 3000);