I use the ...doku.php?do=sitemap command. After I exclude some namespace, for example playground (permission=none), it still shows in sitemap.xml.
<url>
<loc>https://www.watch-wiki.net/doku.php?id=playground:playground</loc>
<lastmod>2021-07-25T16:54:28+02:00</lastmod>
</url>
As I have seen, the hidepages setting has no relation to the sitemap.xml (=file), only to the sitemap (=overview). It would be reasonable if this would be the case.