What you have said is correct, but here there are two cases payment of dividend out of profit and free reserves in case of no profit or inadequate profit.
In case payment of Dividend out of profit - You are correct
In case of rule 3 of Dividend - It's only mentioned that " The amount so drawn shall first be utilised to set off the losses incurred IN The Financial Year in which dividend is declared before any dividend in respect of equity shares is declared. "
It's no where mentioned pervious financial year or years.
And in section 123 it's says set off AGAINST PROFIT of the company.