Hello,
replaceVariableByHTML doesn't keep the styles used by the placeholder, you need to set them in the imported HTML, otherwise, default imported styles are applied.
When doing a block type replacement, as replaceVariableByHTML does, styles from the placeholder aren't kept. Doing an inline type replacement, as replaceVariableByText does, almost all styles from the placeholder are set. On the documentation pages, you can read this information explained.
If you want to preserve the placeholder styles (pPr and rPr) when replacing a placeholder with HTML using replaceVariableByHTML, you need to use the stylesReplacementType option available in Premium licenses.
Regards.