When dividing the same measurement, why is the result not a flat line?

As a test to check that the division is working, you can use the same measurement as active and reference. The result should be a straight line at 0 dB for the magnitude frequency response.

But if  is checked, the time window can be different for the reference measurement. This will cause some deviation from the straight line at 0 dB.