Hey Mick,
Thanks for reaching out!
If you set the tag of the basic text element in your phantom example to div or span, the problem solves itself (as it does in your “normal” example).
The default styles p:last-of-type + h(x) provide spacing between paragraphs and headings that would otherwise stick together. Otherwise, you’d have to give every heading a margin-top, so this doesn’t happen, or remove the margin-top very frequently - and that would be quite inconvenient.
Best regards,
timmse