Hello,
The setRTL method doesn't transform a LTR template into a RTL template. This method does the following:
Sets global right to left options
RTL options are enabled in the document and also new contents added apply RTL settings, but existing contents and styles are not transformed to RTL. If you want to change existing styles, for example to set RTL and bidi to existing template styles, you'd need to use DOCXCustomizer.
We recommend you generate a new RTL template from your LTR template.
The error you get may appear if some footnote or endnote content in the document doesn't include style tags to apply RTL.
Regards.