This is a difficult one actually, OP, and I can’t say for sure without reading the contract and maternity policy (as there could be a nuanced clause in either which covers the point one way or another…)
I don’t think PPs suggestion that you “accepted” the pay is necessarily correct. I’ve tested this point in the ET before - you have no control over how much your employer pays you or when, so it’s not open to you to “accept” or “reject” it - it’s paid to you automatically and not in your control. You weren’t paid in error anyway, so were under no obligation to raise it (in my view) as you were, at the time, correctly paid.
If they had no contractual right to require repayment, and it wasn’t in the policy at the time you took the leave, I think you have a reasonable argument you aren’t bound by a repayment clause (for the full period anyway). You also didn’t sign it to indicate express agreement.
The flip side though is that you didn’t object to the term at the time it was sent either. You might have accepted it by conduct (in not raising it as an objection at the time), but it’s not like you continued to attend work so could impliedly have accepted the term - you were off work at the time! And they would have the argument that, at the time the clause was operative (ie the time you chose not to return) you were aware of it and so are bound by it and have to repay it.
My gut feeling is that they should have outlined, before your leave began, the repayment requirement, and asked you to sign a document confirming you intended to return for six months - and that you understood the repayment requirement if you left. Without that, I can see a court sympathising and deciding it was sent too late to be enforceable.