Markdown is for human text and supports structures used in normal human text. It is not a programming language, a layout engine, or a data format. Markdown is not intended to be the text version of “Turing Complete”.
In human text, headings demarcate sections and subsections. The only way one terminates a section in human text is to start a new one, whether same, lower or higher level. This is not a limitation. It is the nature of linear text flows and works this way because it is less confusing for human readers. You can prove me wrong by linking to one example of a book, essay, academic paper or technical documentation where the text flow drops into a sub section and then pops back out to the parent or root section without starting a new section (Is this what you mean by “manage with lot of concatenated headings”?). I don’t know what you mean by “structural and logical confusion”. All the kinds of writing I just mentioned have used headings that work exactly how Markdown headings work for at least hundreds of years.
Or could you please link to an example showing how “coding developers who look at text structure in a different way”? You haven’t explained what you’re trying to do. Maybe this is an XY problem.
There are cases in natural human text where one drops into a nested item and later pops back out to the parent:
- nested lists (supported by Markdown)
- nested text blocks (supported by Markdown block quotes, fenced code blocks, and indented code blocks)
So if you are trying to shoehorn your coding developer use case into prose-oriented Markdown, perhaps you should one of those. Otherwise you might want to look at a more machine/data oriented format like XML or YAML.