Ok I managed to find where it was blocking everything.
The issue is that I was setting a black background for the second figure. To make the overlay disappear for NaNs values, then the solution is:
ax1 = axes;
set(gca, 'Color', 'black'); %sets black background
colormap(ax1,cm_mask); %colormap I created which makes the land mask brown
shading flat %get rid of the lines on the figure
ax2 = axes;
imAlpha = ones(size(smb));
imAlpha(isnan(smb)) = 0; %create NaN mask the size of the overlay
e1 = pcolor(ax2,lat,lon,overlay);
set(e1,'alphadata',0) %make NaNs transparent. CAUTION: Use "Alphadata" and not "facealpha" or everything
%will be transparent
colormap(ax2,cm_overlay) %colormap I created for the overlay
set(gca, 'Color', 'none'); %IMPORTANT: set the second background as transparent otherwise it covers the land mask
My mistake was to use a black background and "facealpha".