I deployed a website on github pages. I've added a sitemap file to my repository with the name sitemap.xml. I am able to access it by going to https://sitemaptest.github.io/sitemap.xml however, when I add it to google console, it says cannot be fetched. (sitemap could not be read), and got http error(404).I check the url by google url inspection,but it works well. I don't know why i cannot submit the sitemap file , ()
When sites and sitemaps are new, Google takes a bit of time to show a change in fetching status. Since that URL is perfectly accessible by Googlebot (returns 200 when changing the User Agent using Chrome Dev tools), I wouldn't worry about Google not being able to see the URLs in your sitemap. Give it a few days to see if that "fetching error" message has changed.