This question already has an answer here:
We migrated our site from HTTP to HTTPS. Then we verified our property in search console and submit the new sitemap with HTTPS URLs.
After submission it has the error "Your Sitemap or Sitemap index file doesn't properly declare the namespace."
This appears to be because we used
https://www.sitemaps.org/schemas/sitemap/0.9 instead of
http://www.sitemaps.org/schemas/sitemap/0.9. Is this really important to use the HTTP version of that URL in sitemap? That URL is redirected to HTTPS and google is also supporting HTTPS.