When the cursor gets misaligned like that, it’s usually caused by the font changing in some way. Reloading obsidian usually fixes the issue.
Regarding your second issue, that’s an unfortunate side effect of the WYSIWYG style headings. There’s no good way around it until obsidian’s official WYSIWYG editor is released.