The content line to the ToC should refer to the starting page of the section. If \addcontentsline is after the section, and the section is more than one page long, the ToC entry will point to the last page and not the first one. This fixes the order.
The content line to the ToC should refer to the starting page of the section. If
\addcontentsline
is after the section, and the section is more than one page long, the ToC entry will point to the last page and not the first one. This fixes the order.