This is a setting in the TOC styles. In particular, I suspect, the tab setting.
The titles or headings where the .... shows and the page number is justified are longer than the ones where this doesn't happen. A tab, with a tab leader of dots, pushes the page numbers out to the left edge. There is a tab stop in the format for the TOC style that is caught by the tab for the page number in the short headings.
TOC Tips and Tricks