Inequality constraints and Lagrange multipliers

Hi everybody, I’m trying to simulate a perfect foresight model with three complementary slackness conditions. Dynare (seemingly) solves the model but the inequality constraints are not satisfied: in some time periods, lambda2 and lambda3 become slightly negative, which should not happen. Does anyone know an alternative way to enforce these constraints, possibly without resorting to the penalty method ? Thanks.

Do I understand you correctly that the problem is that Lagrange multipliers that should only be positive become negative at some points in time?