I have found the solution here https://blog.chapagain.com.np/wordpress-contact-form-7-quick-fix-spinning-arrow/
The other solution I found was changing a configuration setting in the contact form plugin’s file.
Open file:
/wp-content/plugins/contact-form-7/wp-contact-form-7.php
Change this:
define( ‘WPCF7_LOAD_JS’, true);
To this:
define( ‘WPCF7_LOAD_JS’, false );
This one is a quick fix. But, when you apply this fix, your form will not be submitted through Ajax. Instead, your contact form page will be reloaded when you submit the form. I did try this solution and it worked for me. However, I did not use this because I want my contact form to be submitted through Ajax.