Hello,
Please check the documentation available on https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections. To generate sections with their own headers/footers, a DOCX needs to be generated for each section and then merge them using mergeDocx to get a single DOCX keeping all headers and footers.
Regards.