The function addTocToggle() in lib/scripts/script.js adds a toggle object (toc__toggle) to the DOM. The object is separate from the toc__inside object (which holds the actual content of the toc), however, when toggling the toc, visibility attributes of both objects is changed together (see the toggleToc() function). For some reason, during initialization of the toc_toggle object the aforementioned function assumes the toc__inside is initially visible (i.e., has style.display == '') hence it initialized the toc__toggle such that it shows a closing button.
Problems may arise when, for instance, a template overrides the the default visibility of the toc__inside object, and sets it to 'none'. In my case, the typo template does it by means of tying it to window initialization (using addInitEvent()). Nonetheless, by the time the event is triggered, the toc__toggle object has not been created yet, so there is no way for the template to override that object's settings; it settles for overriding visibility of the toc__inside object only, which results in a non-visible (closed) toc that has a close button attached to it... quite lame.
I devised an easy fix that seems generic enough and generally desirable: instead of assuming that toc__inside is initially visible, addTocToggle() will actually check its display status and set the toggle button appropriately. Attaching a diff.
Thanks for your help.