I am curious, though, why you are using the above setup instead of using ExpressionEngine templates in a normal manner to manage and display your content. I’m going to go ahead and move this thread to the How To forum, though, since the issue of the PHP error being caused by ExpressionEngine is resolved.
I’ll fess up here as the (non-)developer behind the template system 😊 I built it originally a couple of years ago before the MSM and before 1st party embed variables and the like. It offered a number of advantages - reduced redundancy (the normal EE way encourages duplicating your structure, which is avoided here), variable inheritance, uncoupling templates from url structure, easily run multiple sites from the one installation, etc. There were a few drawbacks which were relatively minor, but for a quite a large site turning the templates inside out in a sense (in this simplistic form) worked quite well. Anyway, just thought that background might be of interest, fwiw! 😊