Text after div tags does not get rendered properly

It is fully specified, standards-compliant behavior defined by the CommonMark spec § 4.6 — HTML blocks.

The key rule is HTML block type 6. The CommonMark spec explicitly lists div(along with p, blockquote, table, h1–h6, ul, ol, li, hr, etc.) as a block-level tag. When the parser encounters a line starting with one of these tags, it opens an HTML block with this end condition:

End condition: line is followed by a blank line.

Your other examples are inline elements, and behave differently.