Hello,
The existing headers in the section are removed when calling addHeader. So you need to call it using the same addHeader call:
$docx->addHeader(array('first' => $firstheaderTable, 'default' => $headerTable));
If you need to generate more complex header/footer layouts or apply them per section you need to use the features included in Advanced and Premium licenses: https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections
Regards.