HI Partner
IT seems that there's an onload script on the form which might be causing this error, check if any OOB/custom onload script is present for the form
You can check for onload script by navigating to settings -> customization -> customize the system -> Expand the entity -> select the form and click on form properties.