sitemap.xml with blank space on line 1

I have a plugin that generates a sitemap and creates a redirect for a multisite installation. When the sitemap is generated, it is stored in the download directory of individual blogs: /wp-content/blogs.dir/1/sitemap.xml but is available via /sitemap.xml

When you navigate to the site map through its current location, it works as expected, with no additional line. However, when you access it through the redirect, an empty space is added to the first line of the site map, causing an error.

I've investigated this problem on different support forums and they all indicated that an extra line at the end of the themes functions.php (after?>) Could create this problem. Alternatively, an additional line in wp-config.php, index.php or another plugin. I've reviewed all these options to no avail.

One suggested solution was to use the Health Check plug-in, which disables all plug-ins and modifies the default theme, and then allows you to activate the plug-ins one after the other. to try to find the problem. Again, this has not brought any solution.

With all plugins disabled and the default theme installed, site plan redirection still existed and resulted in the addition of the extra line.

As such, I started asking myself if it was a fundamental WordPress problem and I reinstalled all the Core scripts, but again in vain.

I have gone through the logs of errors and nothing.

Any idea of ​​where I should turn to try to solve this problem would be very welcome.

thank you,