gives parent-child warnings and a broken structure:
Package tagpdf Warning: There are still open structures on the stack!
(tagpdf) The stack contains
(tagpdf) {Document}{Document},{Root}{StructTreeRoot}.
(tagpdf) The structures are automatically closed,
(tagpdf) but their nesting can be wrong.
gives parent-child warnings and a broken structure: