I also had the “stack level too deep” error a while ago. Unfortunately I can’t remember the details; I loosely recall it was a structural error, certainly on my side.
Here, if you have not tested that already, is it possible that you have a circular include somewhere? Removing most of your lines and then slowly adding back might isolate the problem to one of the xx.html includes. Good luck!