If you are tying to access the sitemap in Yoast SEO and getting the following error.
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Then the main reason for this error is that you have plain selected in the permalink settings. Just select post name in the settings and it will fix your problem straight away.