So I tried to create a new template with only this piece of code in order to make a little more investigations… However, the generation worked fine for this new template !
You have this error when opening the word document inside Eclipse ? It’s probably related to the integration of MS Word with Eclipse… not sure how to improve that.
Some time this can happen when the document is already opened in MS Word outside Eclipse or by some other process. I don’t think this is related to the document itself.
Something in the footer is generating an invalid document. Default header and footers presentations from MS Word are known to produce his kind of error with M2Doc.