Changing the $wp_version does not replace the core files for the WordPress so the issue is not resolved. I have used the HostGator hosting it had the easy option to replace the core files under the website settings. If you have command line access to the website doc root then you can try running these, commands to replace the core files. wp core version // This command checks the current version of your WordPress. wp core download --version= --force //replaces the core file for the wordpress site.
Make sure you run these command where you have your website doc root (example public_html which is the default doc root ), also do take a backup of the database before you run these command as some times wrong core files replacement may damage the data files.
Once this is done, To check if the issue is resolved for the website please access the website in the incognito window as the normal window might still show the error because of the cache.