Mixing HTML and Markdown was never easy. Gruber originally said (simplified): Markdown doesn’t get parsed in block elements, but it does get parsed in inline elements.
CommonMark goes a step further by declaring all kinds of stuff with empty lines between tags, see the docs on HTML blocks.
But even this doesn’t seem to work, I tested lots of combinations that should work. I guess it’s simply a parser bug, you might want to report it.