Why does my program fail when it runs iteratively

Perhaps the problem scaling is bad. But not necessarily. However, CVX accepted your problem, but its unreliable Successive Approximation method failed.

If you have Mosek available, then use that with CVX 2.2 Otherwise, follow the advice at CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions .