While the XHTML renderer simply ignores headers with empty text the metadata renderer doesn't have such a check which means that depending on whether the TOC is loaded from the metadata or directly taken from the XHTML renderer you get an empty TOC entry or not. If the first header of the page is empty the metadata renderer sets the page title to an empty string. I'm thus not sure if we should simply ignore empty headers in the metadata renderer or if we should just prevent the TOC entry creation.
[Edit] As mentioned in this forum thread: https://forum.dokuwiki.org/post/38239
it is documented that empty headers produce section edits. This is no longer true. Either the documentation needs to be changed or the xhtml parser shouldn't simply ignore empty headers but instead only prevent the output of the actual header but still open/close a section (if this doesn't confuse the section highlighting JS code).