Try deselecting the sitemap functionality in the WP dashboard menu, save, and then re-enable. This usually works.
Wen’t to the yoast sitemap menu. I deactivated the sitemap, saved, activated it, saved. Now it works.
10 years ago, I would have done that first. But I didn’t know the old windows fix for everything is still functional.