The rank condition ISN'T verified! simple pe model

Hi all,
I am trying to solve in dynare quite simple partial equilibrium firm model.
In the model firm maximizes it’s profit, choosing debt and capital. The cost of debt depends on current leverage level. I find pretty reasonable steady state given the calibration. But the rank conditions are not verified. I tried to do a sensitivity analysis to check whether it was a question of calibration. But no success so far.

Could someone please have a look at it? It’s a model with four equations.
Thank you!
pe_model.mod (3.7 KB)
pe_model_steadystate.m (1.8 KB)

The model features explosiveness. What stabilizes debt in your economy?

As this is partial equilibrium, I didn’t consider debt stabilization. What can do it? Adjustment costs on debt?

I don’t know, but your partial equilibrium model seems to be explosive. That cannot work and you need to figure out why that is the case.

Thank you for the suggestion. This is the first time I have encountered such a problem. Are there common approaches to solving the issue? Or maybe you can point me to a discussion about where to start.