The file double2rgb() does not do the same quantization as pcolor()/imagesc() will with CDataScaling = 'scaled'.
Consider this example comparing double2rgb() against imagesc() and MIMT gray2pcolor().
A = lingrad([80 500],[0 0; 0 1],[0; 1],'double');
B = gray2pcolor(A,map,'default');
C = gray2pcolor(A,map,'cdscale');
D = double2rgb(double(A),map);
set(gca,'TickLength',[0 0]);
screenshot = frame2im(getframe(gca));
screenshot = imresize(screenshot,size(A),'nearest');
screenshot = im2double(screenshot);
outpict = [B; C; D; screenshot];
Regarding double2rgb(), I would go so far as to say that this is less of a "difference" and more of a simple OBOE. I dunno; maybe objectives were different than what I expect.
The 'cdscale' mode of gray2pcolor()/uniquant() is intended to emulate imagesc(). While it's close, the operations do differ, so there is always room for slight differences in the way things get rounded.
gray2pcolor() is part of MIMT, though I have posted compact versions on the forum:
The second part of the problem is that you're relying on the input limits to be selected implicitly. The quantization process involves normalizing the data, typically with respect to the data extrema. If you process the image in chunks, the extrema of each chunk will vary, so the mapping will vary too. If you want the chunks to appear like the original whole image, you need to process them with respect to the extrema of the whole image. Both gray2pcolor() and double2rgb() allow these to be specified explicitly.
A = lingrad([80 500],[0 0; 0 1],[0; 1],'double');
Clocal = gray2pcolor(Alh,map,'cdscale');
Cglobal = gray2pcolor(Alh,map,limits,'cdscale');
set(gca,'TickLength',[0 0]);
screenshot = frame2im(getframe(gca));
screenshot = imresize(screenshot,size(Alh),'nearest');
screenshot = im2double(screenshot);
outpict = [Clocal; Cglobal; screenshot];
Alternatively, you might consider converting the entire image to RGB first and then detiling it. I don't know if that works for your needs.