What is the exact error you’re getting?
The model is quite complex. Do you get the error if it’s simpler, e.g. with just a single level in that hierarchy? The .eval() method is quite nice for debugging shape issues. I would comment out lines of the model until you can successfully get it partially compiled, then check shapes of all your variables and make sure they are what you expect.