I was able to solve the issue by switching to glpk solver. The solution now matches the analytical solution.