1) Low frequency discrepancy
When producing FFTs in MATLAB it is critical to get the frequency vector correct. In my original example I had been creating a frequency vector using:
f = linspace(1,fs,Ns)
where fs is the sampling frequency and Ns is the number of samples. I thought this was correct as when indexing in MATLAB you always being at 1. However with an FFT the first bin is DC, i.e. 0 Hz. The low frequency discrepancy was caused by a bad frequency vector. For anyone seeing similar issues, I found the best way to create this vector is with:
f = (0:Ns-1)*(fs/Ns)
2) High frequency phase issues
After further investigation I found that the phase issue is sampling frequency related. Illustrating the phase vs. sampling frequency showed that by increasing the sampling frequency, the phase accuracy improves.
Fig. 1 Phase vs. Sampling rate of the NI 6251 DAQ with input connected directly to the output
The original problem saw over-compensation, which has now been reduced as there is less of a problem to compensate.
3) Input capacitance
As a side note, I haven't found any reason for a series capacitance anywhere in the DAQ as I first assumed, and presume there is not a compensation capacitor in the input stage (although it seemed like a logical conclusion given the question). For those interested I am including a capture of the transfer function from 1 Hz-20 kHz of a 1 M series resistance between input and output, showing the effects of the parallel input capacitance. I have then modelled this with an RC circuit transfer function, and fit the curve using an optimisation algorithm to select the best capacitance. The resistor was measured with a multimeter with a resolution of 0.001, and an accuracy of +-0.8% + 3 kohm, so that defines the limit of accuracy of the measured capacitance.
Fig. 2: Comparison between modelled and measured transfer functions of a 1 Meg series resistance and the unwanted input capacitance. The measurement was made at fs=1 MHz to minimise phase inaccuracy.
There is a pretty good fit, meaning the capacitance can be compensated for in any further measurements.
Thank you to both Tony Stewart and Daniel Turizo for their help in reaching this answer.