Have you looked at the solution from each iteration of your one variable at a time algorithm? it apparently is diverging, creating huge values as input to the next iteration. I presume your algorithm is crude, with no safeguarding such as line search or trust region. There is a reason why high quality non-convex solvers are more than 10 lines of code long.
If you start from a different starting point,. you might (or might not) get lucky.