Hi @Connor Shore I investigated files you have shared and it looks to me that issue was caused at the code level when file(TocUpdateIssueBeforeUpdate) was generated from the template you have provided.
When I used this simple code to generate file from your template issue doesn't occur. Could you please test it on your site and let me know how it works for you.
string templatePath = @"C:\source\TestFiles\TocUpdateIssueTemplate.docx";
string outputPath = @"C:\source\TestFiles\DocFromTemplate.docx";
MemoryStream memoryStream;
using (memoryStream = new MemoryStream())
{
using (WordprocessingDocument generatedDoc = WordprocessingDocument.CreateFromTemplate(templatePath, false))
{
MainDocumentPart? mainDocumentPart = generatedDoc.MainDocumentPart;`
generatedDoc.Clone(memoryStream);`
File.WriteAllBytes(outputPath, memoryStream.ToArray());
}
}
Best regards,
Mariusz Kaszewiak