By the looks of it you are running k-nearest neighbour on a single vector of data; that is a set of samples with only a single feature each.
Looking at example 1 on the method documentation, it expects a matrix in which each column is a sample, and each row is a feature. It seems the technique used to fill in missing nan values only works if there are multiple features for each sample (i.e.: if you are passing in a matrix).
As you are passing a vector (i.e. multiple samples and a single feature) the algorithm cannot fill in the NaNs, so you would have to remove them before applying the k-nearest neighbour function.
Something like:
temp_stage = ds.stage(~isnan(ds.stage));
knnimp = knnimpute(transpose(temp_stage),k);