When you use nanstd each standard deviation is calculated only using the data for that column, so nanstd can ignore all NaN results for that variable. However, when you are computing the covariance, we need to use multiple variables for each correlation. For this reason, MATLAB by default removes any observations (rows) which have any NaNs in them prior to performing any calculations. This means that you are removing valid data points for the calculation of the variances of variables, because the corresponding observation of some other variable was NaN. To achieve the result you expect you would wan to use the 'pairwise flag'.
Y = nancov(...,'pairwise')
Note: Since we now have different dimensionality for each of our measurements, we are no longer guaranteed that the resulting covariance matrix is positive definite.