There is an extra _ in a variable used to generate the sitemap_index (if needed?). As per this description:
on line 1802 in the file recently downloaded:
sitemap__index_header = GENERAL_SITEMAP_HEADER
but there is no reference to sitemap__index_header in the whole file.
only to sitemap_index_header.
so i removed one _ and now it's working!
The created sitemap_index also contained malformed xml. The first tag was <urlset> but the closing tag was </sitemapindex>.
Not sure if this had anything to do with my specifying .gz for the sitemap files or not.