Unexpected dynamic of interest rate

Hello!
I set up a model to study population aging problem and there’s no monetary policy.
When the aging shock come, I expect the government debt grows. However it’s opposite. I find out the problem is that the interest rate below 1, which influence the government budget constraint.
In my model set, there should not be sudden shock on R.(Rk is the Return rate on Capital)
Is this because some time errors?
Here’s some equations:

R(1)=(1-tau_k)*Rk(1)+1-delta;(tau_k is the tax rate)
T + Pz*Z + B = R*B(-1) + G; (Pz*Z is some type energy tax)

Model0107.mod (6.2 KB)
Steady_Model0107.m (4.5 KB)
here’s my code pack

Yes, there must be a timing error.

R(1) = (1-TAU_k)*Rk(1) + 1 -DELTA;

almost surely should be

R = (1-TAU_k)*Rk + 1 -DELTA;

because it looks like a definition.