Bilevel optimization with acados

Sorry to bother you, I’m still facing issues here.

The KKT conditions of the problem are
\frac{\partial \kappa}{\partial s}(s*)=0
s \in ]0,1[

So my initial guess was to add in the constraints of the model s \in ]0,1[, \frac{\partial \kappa}{\partial s}(s,z)=0 and \kappa(s,z) \leq 0
Doing so, I change the integrator type to IRK to handle algebraic variables, but the value of s does not seem to evolve and is stuck at 0, leading to an error status 4 (because the constraints are not met)

When trying to use the variable s as an input of the system as suggested here, i get the same issue, the variable is stuck at 0, even if I set initial conditions.

Do you know how this can be solve ?
Thanks again,