NaN for Theoretical Moments

Hello everyone,

After running the mod file I get bunch of NaNs for values of approximated theoretical moments in the Dynare output, even though I got IRFs as a result of the simulation. I am attaching my Dynare file and the complementary MATLAB steady state file for your reference. Both are slightly modified files from my previous post here in Dynare forum a week ago.
Model.mod (13.4 KB)
Model_steadystate.m (9.6 KB)

I thought there might be a unit root problem here but the model diagnostics did not detect any obvious problems with this mod-file. I suspect also that some variables (e.g., labor allocation for entrepreneurs and human capital stock for wage-earners) take negative values along the transition path, and this might cause all these NaNs. Not sure if my naive guess is correct though.

I will appreciate any advice here.

If you add check; you will see that model model indeed features a unit root.

Thank you, I will investigate further at this matter and will look up the similar topics (unit roots for forward-looking variables) to find the potential solution for my case.