Puzzling "trend not compatible with balanced growth path" error

I have a DSGE model with two stochastic trends (with two different mean growth rates). To allow for cointegration, I figured out (or thought I had figured out) how to include an error correction term in one of the trends. By trial and error in the file with May2022 in the title, I determined that the lagged log difference in the stochastic trends required the addition of the difference in their growth rates for the steady state to be computed (line 66 in the code). That model solves fine and I can estimate the coefficient on the EC term. But a simpler version of the model (file dated Aug2022) with the same dynamic structure and the exact same specification of the stochastic trends results in the “trend not compatible with balanced growth path” error. If I remove the error correction term the model solves. I can’t figure out why this error correction specification works in the one case and not in the other. I’m not sure this is something that is easy for anyone to help with, but perhaps there’s some issue that’s easy to spot without going through the whole model.
investmentGE_Aug2022_hfac_2tr_EC.mod (4.6 KB)
investmentGE_May2022_S4_2trHFAC_EC.mod (8.0 KB)
cidata59.xlsx (13.8 KB)

Are you sure your specification is correct. When using the same parameters

gamu=.01; 
gamd=.003;
thetaud = 0;
thetadu=0.01;

both files run.

Interesting, thank you. It must be the numerical tolerance of the balanced growth check, where a .001 difference in the parameters caused it to fail, even though I specified the equation to be robust to that. (I’d had this same problem once before when I used exp(gamu) instead of 1+gamu, but there must be some approximation that throws it off. Thanks again.