Question Marks in TOC when compiling + chapters on the header

I have created a ToC, and when I export to .rtf, the hierarchy of the sections is fine, but it only shows question marks for pages.

After reading 22.2.2 in the manual (p554), I have tried printing the document as a .pdf, as they say that “some word processors will require you to regenerate the page numbers tokens by running a test print preview once; they will appear as question marks until you have done so.”

The numbers do not show in the exported pdf, and still do not show in the .docx.

I suppose I must be missing something, but I don’t know what…