The levels are ignored when you sort by page.
Thanks for the response.
Is there a workaround for what I what to achieve?
Link all stories in the correct order.
To start at the correct frame, adjust your paragraph styles in the keep options section.
I don't think there's any way to sort paragraphs other than by story and position on the page when you sort a TOC in page order. When sorting by levels is possible (alphabetical sort), Level 1 is the top level and appears before Level 2, and so on.
Seems to me you re expecting the normal behavior -- your level 3 heading is above the level 2 on the page and you want it to appear before it in the TOC -- so what are you doing that keeps this from happening? Do you have one story, or multiple threads, on this page? Screen shots of the page, the TOC dialog, and the TOC might help.