Here is the answer:
Change to the following (i.e., replace && by & below):
if ~isChunkModeActive && ~any(startsWith(fieldnames(meta), "Chunk"))
return
end
Because I am unable to make this change in Matlab due to permission issues, I just generated a copy script in my local folder. And it worked