Steps to replicate the issue (include links if applicable):
Render a page containing a special page transclusion, for instance {{Special:NewPages}}, in Parsoid and in Legacy, with Vector2022.
What happens?:
The sections of the NewPages are displayed in the TOC on the side of the page in Parsoid, but not in legacy. If no other heading is added to the page, no TOC is added to the skin.
What should have happened instead?:
The TOC should be displayed consistently between the parsers.
Note
It seems like Parsoid is doing the right thing here - the only reason why the legacy parser does not fill in the TOC data is because the special page content is replaced by a strip marker when Parser.php generates the TOC data.