QP solver returned error status 3 in SQP iteration 1, QP iteration 1

Hi :wave:
I have used Python API to solve NMPC problem and it works fine in Python API. When using the C-generated code, I have this issue QP solver returned error status 3 in SQP iteration 1, QP iteration 1. but it happens sometimes and not always. I have read the related issues in forum and github such this and tried to set LM but i couldn’t find a way to solve this issue. I am using ocp.cost.cost_type = 'NONLINEAR_LS' . The problem mainly occurs when I add to the cost function one term (a + cd.atan( w_i - b*w_i)) where `a > 0,w_i>0 and b>=0 so I can’t see NAN solution for QP. Again I should mention that the error occurs not always but for the same C-generated code and even for the same dataset so often it gives solution and sometime gives this error. Any help will be appreciated.

Best Kinds
Muhammad