Hello,
We have tested the script before posting it. After moving the addFooter code before the code that creates new sections, a single page is created with the new sections (two columns, three columns, and a single column) and a single footer. We have opened the DOCX output with MS Word 2010, MS Word 2013, MS Word 2016 and LibreOffice 6 and in all cases the content is correct.
We recommend you to check the code you are running, maybe some lines are duplicated or other issue. We have checked that our previous code is working correctly.
Regards.