The potential answer could be, do not specific the dimension labels when you do minibatch. Concretely,
mbqTrain = minibatchqueue(cdsTrain,2,...
'MiniBatchSize',minibatch_size,...
'MiniBatchFcn',@preprocessMiniBatch,...
'MiniBatchFormat',{'',''},... % do not specific the dimensional labels or set it carefully
"PartialMiniBatch","discard");
You may get another error by mse function when you cauculate the loss, and if you specific the dimensional labels, say mse(Y, X, "DataFormat", "SSB"), it would be good to go if no addtional errors.