Yeah I see but comparing Case 3 and Case 4 in the above example, there is only 1 day difference between StartDate and EndDate however required lookback period jumps 4 years back suddenly.

Looking at all cases above, the MinutesPerDay parameter seems to be defaulted to some value other than 360 if StartDate isn't defined.