Remove minor cycle from time series
Your approach seems awfully complicated. It looks like the frequencies of the "minor cycle" are much higher than the "major cycle" and the ramp so a simple lowpass filter should do the trick. If you don't know the frequencies, a simple FFT analysis can be done. 

Subtracting filtered versions of signal is tricky since you need to carefully watch time alignment and phase distortion in the filter.