Generalized Schur (QZ) failed

One possibility is to check, as the message says, whether you are respecting Walras Law.
See whether you are specifying aggregation conditions that are redundant given the other equilibrium conditions you have specified. From a quick look, I can see that you have a lot of what look like identities and market-clearing conditions. Start the debugging from here. Inspect these identities and market-clearing conditions and ask yourself which ones do you really need.
Since you seem to have plenty of markets in your complicated model, it might take a while.