@Danilo Looks like an incompatible change in ROOT.
The GetUpperRefObject (correctly) returns hData in ROOT 6.38 and (incorrectly) hStack in ROOT 6.36 (and ROOT 6.34).
@bethlong06 Try with (it should work with any ROOT version):
TRatioPlot *rp = new TRatioPlot(hStack, hData);