You have to make sure your site url and xml url are in harmony. I suggest this before playing with plugins and other stuff:
Go to settings>general
check your site address url. Is it https://www.mysite.com or is it mysite.com?
Go to settings>xml-sitemap
Go to ‘location of your sitemap file’. Make sure the detected url (or custom depending on what you are using) matches what was in your general settings with the addition of /sitemap.xml (or whatever you call yours).
If you have https://www.mysite.com and your xml is mysite.com/sitemap.xml it won’t work. Make sure they both either have or don’t have www.