Per (16) and (17), dim = 3, so Z is 4 by 4, which means P needs to be 5 by 5, but you show P as 4 by 4. Does this P actually correspond to dim = 2?
I can’t determine what your P matrix is based on the digits shown - I don’t know what those 0.0000 * 1e+07 and -0.0000e+07 entries are . Are they all really (or should be) exactly zero? Having the largest element be 5.9598e+07 may not be great from a numerical standpoint. If those +/- 0.0000e+07 really should be exactly zero, you could set them to exactly zero and re-scale P by dividing by 1e±7, which will scale the optimal objective value, and perhaps will improve the numerics of the problem.
It would be better if you copy and paste your program and output, and use the Preformatted text icon, rather than using an image. Also, when showing the values of variables, use format long.