In order to get the first heading of a .docx file to be recognized in the TOC, I had to put a blank line before the heading. The heading could not be the first line of the .docx file. Yes, I proved this with .docx files made by LibreOffice through a series of tests.