There are a number of DT issues like T371125 that are caused by the ParserAfterTidy hook being run too often and in too many contexts: it is run for sub-parses, for interface messages, for random text on special pages, etc.
Eventually we might solve this by moving processing into OutputTransform, but keeping it pre-cache.
But in the near term, the issue is mostly that core doesn't have an unambiguous "at top level" indicator to flag when the ParserOutput has the complete top level contents of an article page, ie not a sub-parse or interface text, etc. This could be addressed by adding an ArticleAfterParse hook (bikeshed bikeshed) like we added ArticleParserOptions to allow DiscussionTools to post process *only complete pages* not partial parses.