Can you walk over the logic you are using there to create your report... it seems that sometimes you are picking the ScheduledPaymentDate as From Date and sometimes you are not. Also sometimes you are doing subtraction between CumulativeRegularAmountToPay and CumulativeRegularAmountPayed on the same row, but other times you do it on the different rows for OverdueAmount column.
Debt varies depending on the payments received and on the dates when these payments have come.
Therefore one record can turn into two intervals - a debt from the moment of delay on the schedule of payments, and a debt after payment if payment was not complete.
A set of rules is required. It is necessary to analyze both the next record and the previous.
I created a lot of flags to identify each case, but so far I have not achieved the result.