I struggle with wrong order of items in TOC. Initially it is correct - divider number (1) goes first then follows divider heading, all referenced to document page 12. But the second divider has different page layout - and it leads to that divider number 2 in the TOC falls under its headings, still reference to document page 19 is correct.
InDesign reads the page from upper left to lower right.
The only way I know to trick it in the TOC is to add non-printing frames containing the triggers in a more left/higher position and change the style of the text appearing in the wrong order. I generally put such frames in the top margin, and I make the text red and bold so they are obvious.