It also seems to reveal something about how the output buffering is being handled. Maybe you could shed a little light on this.
My first test involved echoing "Template" and "File" to see which code cam first and it was always "File".
After your post I moved the Framework Builder (FWB) code to the top and echoed "File just below it. That resulted in ONLY "Template" in the output.
Now uncertain if the page code was being executed, I changed the statements so the template had $test .= " Template "; and the file code below the FWB code was $test .= " File "; I output the value of $test on the page and both values were present and in the desired order,
I tried another test with File1 before the FWB code and File2 below, and as expected, The screen output from the header is "File1 Template" but the value of $test is "File1 Template File 2".
So the header of the Template is always where the FWB code is in the header of the file, AND the file header code above the FWB code is executed first and output, BUT the header code below the FWB code of the file is executed AFTER any code in the header of the Template and any output from that code is scrubbed.