Notice Period and Resignation During Maternity Leave
Notice period counts from the date of official resignation. Even though you handed over the entire task before you proceeded on maternity leave, that is merely to ensure your job responsibilities are managed by someone during your absence for the smooth running of day-to-day activities. Since there was no intention or official intimation from your end about the resignation, your HR is checking for the service of the notice period as per the company policy. Normally, if there is any shortfall of the notice period, it needs to be adjusted with the recovery of pay.
You can present your case on health and humanitarian grounds and seek a waiver of the notice period approval from your Department Head and Head HR. Also, you can present that your presence in the office during the two months (notice period) doesn't contribute to any productivity. Since there is also no monetary loss to the company, you have a fair chance to get waiver approvals.