Removing mean from signal massively distorts FFT
I bet you zero-padded the data before FFT. That's not going to work well because the results will be dominated by the discontinuity between your data and the zeros. It is not equivalent to subtract the mean before zero padding vs. after.

Try subtracting the mean, then multiplying the data with a window function, and then zero-padding.

The 0 Hz bin will still typically have a non-zero value. You can get rid of that by calculating the windowed, 0 Hz subtracted signal as (MATLAB/Octave notation):

(signal - mean(signal.*window)/mean(window)).*window


sum can be used in place of mean because the numbers of samples cancel.