Hello,
All sample codes are fully tested and working.
As explained in our previous reply, phpdocx doesn't include Heading1, Heading2, Heading3 as custom paragraph style names in the default base template. If you need to use these custom paragraph style names you must import them from an external DOCX that includes them (generated with MS Word or any other DOCX editor) or use a custom template that includes them or create them.
Please read our previous reply that details everything about this question.
Also, please note that phpdocx includes default CSS styles applied when transforming HTML. These default CSS styles can be changed applying new CSS styles when importing HTML.
Regards.