As documented on Manual:Hooks/OutputPageBeforeHTML, the OutputPageBeforeHTML hook can be executed more than once per page view, if the page content is composed from multiple sources.
For example, if the MediaWiki:Talkpageheader localisation message is defined, it is inserted at the top of all talk pages, and the hook is called twice: for the content from this message and for the content from the page's wikitext. This can be reproduced on e.g. https://fr.m.wikipedia.org/wiki/Discussion:Rhinocéros_de_Louis_XV.
However, we have some code that is not aware of that. This mistake caused major rendering issues in DiscussionTools (T316175#8404730), and after fixing that, I noticed that other extensions are also affected, but in less significant ways, so no one ever noticed. (e.g. MobileFrontend inserts duplicate <meta name="theme-color" content="#eaecf0"/> tags).
Code to review: https://codesearch-beta.wmcloud.org/deployed/?q=OutputPageBeforeHTML&files=%5C.php%24