The HTML Embed part that exists in rich text elements is equivalent to the HTML Embed element that you place in the designer. It’s designed for raw code; scripts, style, JSON, whatever.
If you’re trying to use that to visually display code for visual purposes only, check out Finsweet’s Code Highlight attribute.