Hello,
The code seems correct, but maybe the HTML tags are escaped in the database or any other issue. We recommend you to run the included sample in the examples/Core/embedHTML folder and the documentation available on
https://www.phpdocx.com/documentation/introduction/html-to-word-PHP
to find the source of the issue. Although there's no problem if you wrap your HTML using a root tag such as div or p, there's no need to do it when transforming HTML to DOCX.
Regards.