Hello,
Depending on where the form is displayed, the <h2> tag used in validation error message may cause an accessibility compliance issue.
I strongly recommend updating the markup to replace <h2> with a paragaph <p> tag.
BTW I solved the issue on my side using this snippet:
Thanks for taking consideration of this feedback,
Jb Audras
CTO @ Whodunit & Core Team Rep @ WordPress.org