That should be sent asap so they can find a replacement if needed; 2 weeks is usually is the standard notice time professionally. Depending on the type of job it is - if your not returning wont be of much impact to their day to day operation and you definitely wont want to return in the future, or need them for future references - i wouldnt waste their time or my own time returning just to leave again...I would just apologize for the late notice and let them know today.
I sent mine a week before my return date.
I sent mine a week before it ends, i also had 8 vacation days that i was planning to use
I think you need to send it in 2 weeks before you’re due to end maternity leave or you’d need to go back to work for 2 weeks until the end of your notice, if that makes sense?