Hi @andrea.celentano!
So the error is valid: the idea of combining histograms with an index category is that you can only combine histograms that have the same axes, and the index category will be added as the only new axis. You have different observables for each histogram. So if you fill the values from histogram “sample_0” in the combined multidimensional histogram that has all variables as axes, what should the value for the remaining axes be? It’s undefined and therefore not encouraged, even though it didn’t matter in practice because in the fit, it is again extracting the projections of the histograms, resolving the problem. But your combined histogram, even though an intermediate structure to build the NLL, is not well defined.
There is another reason why combining multidimensional histograms like this is discouraged: memory usage blows up fast. You let’s say you have 100 bins in all three dimensions, the combined histogram will have one million bins, which becomes a problem once you add more channels. For that reason, RooFit allows you to create combined RooDataSets from multiple histograms, which use a different datastructure under the hood: is stores pointers to clones of the input histograms, and if you get values from it, it just gives you “random” values for the observables that are not relevant in a given sample. This is what HistFactory also does.
So long story short, you should just use RooDataSet instead of RooDataHist for dataALL:
dataALL=ROOT.RooDataSet(name+"_data",name+"_data",xALL,Index=sample,Import=dictData)
But even with that change, another error will hit you later because RooFit got more pedantic 
invalid_argument: Value 30.5 is outside the default range [40, 120] of the variable "hcal0_x_2"!
That’s because your MC histograms don’t have the same binning as the data, forcing a change of binning of the observables that can be seen earlier in the script output:
[#1] INFO:DataHandling -- RooDataHist::adjustBinning(hcal0_dh_0): fit range of variable hcal0_E_0 expanded to nearest bin boundaries: [0,500] --> [0,10]
[#1] INFO:DataHandling -- RooDataHist::adjustBinning(hcal0_dh_1): fit range of variable hcal0_E_1 expanded to nearest bin boundaries: [0,500] --> [0,20]
[#1] INFO:DataHandling -- RooDataHist::adjustBinning(hcal0_dh_2): fit range of variable hcal0_E_2 expanded to nearest bin boundaries: [0,500] --> [40,120]
[#1] INFO:DataHandling -- RooDataHist::adjustBinning(hcal0_dh_2): fit range of variable hcal0_x_2 expanded to nearest bin boundaries: [30,120] --> [40,120]
Don’t ignore this error! Since the creation of the MC histograms narrowed the binning of the observables, your data counts are clipped all inside the MC histogram range in the fit, which might have given you wrong results with the previous ROOT versions where the fit worked. In the past, the values were silently clipped without logging anything, which is dangerous exactly for the kind of reasons we see here.
Note: I checked your histograms, and the data counts are zero anyway in the bins that were not part of the MC histograms, so you seem to be safe even with the old ROOT versions. So just double check that and change the range of your RooRealVars from xmin=[0. ,0., 30.] to xmin=[0. ,0., 40.] and it will work. And as far as I checked, the results are identical with ROOT 6.26 or ROOT master.
So you have to update your code a bit to somehow have data and MC histograms with consistent binning. Then it should hopefully work and give you the right results 
Cheers,
Jonas
edit: some ROOT versions might not support the import from a map of RooDataHist to RooDataSet yet, but let’s maybe only try to find a fix for that if you’re actually using such a version (which ROOT version do you intend to use in the end?).