Describe the bug
After writing a Subheading (h3) in a page, any successive Heading (h2) will show in the Table of Contents as Subheadings of the same Heading. (Successive Subheadings to the Heading are nested further). This will happen if you create a ToC before or after doing this.
I’m not talking about Titles (h1), I’m talking about only Headings (h2) and Subheadings (h3). Try h2 - h3 - h2, not h2 - h3 - h1. Putting a Title ‘resets’ the indentation and like you showed works as intended.