Two things come to my mind seeing this:
1) In the auto-numbering for the chapter titles, no matter if level 1 or level 2, do you use the same numbering list? Because then this should not happen. When creating the TOC, Indesign first searches for level 1 headlines, finding "Chapter 2" first on page and then, being in another text frame, it finds the two level 2 headlines of chapter 2 next. More or less logical, but still stupid.
2) Connect the two text frames and this won't happen anymore, but you don't consider it as "sufficient". However, using the same numbering list for all headlines is the better solution.
Thanks for your replay.
The numbers is written text to make it easier to comprehend the example. These are not auto-generated.
In the other thread I had got some response:
"When the textframe flows from an even page number to an uneven page number the problem (like from page 2 to page 3) the TOC is incorrect.
But when the textframe flows from an uneven page number to an even page number (like from page 3 to page 4) the TOC is correct."
Which does not make any sense at all.
Flow your text frames in the correct order and it won't happen.
Re-order chapters by cutting and pasting, rather than dragging pages around.
Keep all text frames in the right order and threaded correctly from page to page.
However, let's say you would use auto-numbering of chapters and subchapters, and they use the same numbering list, it wouldn't happen anymore.