The blanchard-kahn conditions in heterogeneous problems

hi everyone.
I was dealing with a model with heterogeneous firms, two kinds of firms: the total capital is “k”, the capital stock of the first kind of firm is "kp“, while the second kind is “ks”, so we have “kp+ks=k”. Only “k” appears in the budget constraint of the households. ks and kp only appear in the production fuction of the firms.

Of course we should write “k” as predetermind variables. But should i write "ks“ and "kp” as predetermind variables?

I have tried many times, when i write only “k” as predetermind variables, it passed the BK condition, otherwise, it violates it. But why? Is it a bug in Dynare?
jjyj1.mod (1.59 KB)