I’ve tested this & Confirmed that issue happened on Lucee. If cfdocumentitem with type ‘header’ or ‘footer’ means it doesn’t goes to <cfif cfdocument.currentpagenumber eq “1”> this condition, even those value is equal to “1” & All headers have return same ‘page else’. In ACF is working as expected. So please arise a ticket for this issue on Jira (https://luceeserver.atlassian.net).
In ACF :
In Lucee :