How to get errors and make a plot with it

I guess it’s because you again mistake TProfile histograms for TH1D histograms (my example source code expects that the “hDiff” is a TH1D histogram).