Hi,
When you have Yoast’s sitemaps active on the site the expected result is that wp-sitemap.xml and sitemap.xml both get redirected to the Yoast sitemap: sitemap_index.xml. See images which show the redirect: https://ibb.co/88DPncN and https://ibb.co/D4ct4xs.
If that is not happening then there is an issue on the site that needs some additional investigation.
When you added the filer: add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); it likely made some changes to a redirect process that was not working to begin with.
We would like some more information.
1. Can you confirm you are using WordPress 5.6? You can check by clicking on the W in the top left and selecting About. If you need to update, please check with your host provider.?Please know that if you are using an older version of WordPress Core you may experience unexpected behavior with Yoast.?This guide explains more:?https://yoast.com/why-we-dont-support-old-wordpress-versions/.
2. Are all your non-Yoast plugins and themes also updated?
3. We had another recent release. Can you confirm you are using the most recent Yoast SEO Premium, v15.4? If you update, does the issue resolve?
4. Does clearing your caching from your theme, plugin, server, CDN like CloudFlare or browser resolve the issue? If you are not sure how to clear caching from theme/plugin please speak to those authors. If you want to clear cache from the server, please speak to your host provider. To clear the cache from a browser use this guide: https://yoast.com/help/how-to-clear-my-browsers-cache/
5. Can you provide us a copy of your htaccess file? You can copy/paste it here. We ask as there may be a clue in the file that is preventing the sitemaps from redirecting.
6. If you remove that filter and keep the Yoast sitemaps enabled and then visit: sitemap.xml and wp-sitemap.xml do they both show 404 or do they both redirect to sitemap_index.xml as shown in the above images?