Can it be that you have a histogram with this name?
Before these two lines and also after them, try to add:
gROOT->ls(); if (gFile) gFile->ls(); if (gPad) gPad->ls();
You could also try to use:
TGraphErrors *gGMp_Ratio_newRC = ((TGraphErrors*)(gGMp->Clone("gGMp_Ratio_newRC")));