Hello,
When you add headings to a DOCX, when you update the TOC the links are generated automatically (as long as the heading leves are in the range of levels of the TOC). You can't add links manually to a TOC using <a> tags.
We have done some quick tests and everything is working as expected with MS Word 2007, MS Word 2010, MS Word 2013, MS Word 2016, LibreOffice 5, Libreoffice 6 and OpenOffice. And we don't see any anchor path.
Please reply this topic (or send to contact[at]phpdocx.com) with the most simple sample that illustrates your issue and we'll check it. We need to run it, so please send the most simple code without doing external connections such as databases or web services.
Regards.