Error message with {invalid} is due to NaN, Inf, or -Inf in input data

An error message with {invalid} is due to NaN, Inf, or -Inf in input data.

This can happen if you use the results of one problem as input data to another problem, but the first problem did not solve to otimality, hence the “optimal” values of its CVX variables are NaN.