A family of Microsoft word processing software products for creating web, email, and print documents.
How are you "re-attaching the template to the document"
Via the Developer Tab>Document Template>Attach... facility, I am able to attach a template that contains reams of code and a number of user forms and ribbon customizations to a document without any issues, even after opening that template and protecting it with a password. The ribbon customizations from the template then do appear on the ribbon. (I will admit that they do not work correctly in this case because the code is designed to access values from variables in the document that do not exist. It does work however up to that point.
The text of the error message that you are quoting seems a bit strange, because templates are attached to documents, rather than the other way around.
If you want to send your template to me, I will see if I can attach it to a document.