My question is very specific and I hope that someone has done this conversion from HTMLto DOCX.
To do this I took a sample code from github and tried it in my local Ecli
This is not the complete example, is it? Just take a look at ConvertInXHTMLFile.java from docx4j examples.
IMHO you are missing basic parts of the procedure. Furthermore, this topic has been discussed already:
Convert html to doc in java
How to convert HTML to a Microsoft Word document ?
Convert HTML to Microsoft Word Document in Java
how to convert HTML to .docx using docx4j?