T.O.C. behaving weird on insert

like this

This particular feature you are using makes use of tab stops to align the page numbers to the right, and to draw the dashed line between them and the title.

It looks to me as though you have some titles that are short enough that the tab inserted between the title and the page number falls before the point where the stop would trigger. If you look at the ruler, you’ll see there is a tab stop at 0.5". So a simple solution would be to hit the Tab key after the title on these rows that don’t extend.