I dunno about this. Attributes are supposed to be metadata, not displayed textual content. Like it's fine to give the anchor for a section as an attr:
<section id="animals">
<h2>Animals</h2>
<p>Here are my animal facts</p>
</section>
I would feel strange if a browser's built in CSS were reaching into an element's attribute and rendering the text therein as something visible to the reader.
I don't think that matters to GP's point. It's the fact that then "name" attribute stays the same no matter the nesting level.
There's already <figure><figcaption></figure> and <table><caption></table> as examples of embedded heading. The difference there being that figure and table elements very rarely nest.
So allowing h in <section><h><section><h></section></section> to become h1 and h2 would make sense.