Have a look in what way the covariance matrix is computed. Whether it assumes that data is row-wise or col-wise
This might be the reason for the error below