The first one only partially worked, but the second one worked completely, albeit while changing the font. Which is fine by me, but I would still say this is a problem of the markdown system.
If you commonly write chemical formulae in logseq, you may consider importing the mhchem extension for KaTeX, for quicker and more powerful and readable input: