Need JS help with Gravity Forms

In this page https://www.mysite.com/consultations-audits/website-audit-services/local-seo-audit/ (site address is hidden - check chat transcript please) there is a Gravity form in here - https://prnt.sc/gk1o4e . The issue is, when a visitor goes through a validation error, the page loads up and scrolls back to the top of the page. The chat representative helped me with the following JS code

(function($) {
$(document).ready(function() {
if($('.page-id-4545 .validation_error').length) {
if($('#toogle-woico .toggle').length) {
$('#toogle-woico .toggle').addClass('toggle-active');
$('.toggle-box').show();
$('html, body').animate({
scrollTop: $("#toogle-woico").offset().top
}, 1000);
}
}
})
})(jQuery);

It did work for one second, but after that, the page scrolls back to the top again. Please help.