I think we need to be clear about what 'mental capacity' means, as this is a specific legal term, related to the Mental Capacity Act.
Firstly, capacity refers to a specific decision at a specific time. In this case, the decision to go to hospital or stay home for the birth. When you do a formal capacity assessment, you assess a person's ability to take that specific decision. It's not a judgement about that person's ability or thinking as a whole.
For someone to have capacity to make a decision they need to show that they:
- understand and can remember information related to the decision
- weigh up the information to come to a decision
- communicate their decision
So if this woman had been able to say "Yes, I understand that a home birth is risky to me because of [medical reasons eg breach position] and it would be safer to give birth in hospital. However, I would be so distressed by going to hospital that I would prefer to take the risk of me/my baby dying," then there is no way that s judge would make the decision that she had to attend hospital. There must be more going on that we're no privy to - because it's private.
Also, capacity to take decisions can change over time. It's possible that this woman currently has another mental health condition that is impairing her ability to make decisions. So she may absolutely have had capacity to consent to having sex, but may now be more unwell and not able to make a reasoned decision about where to give birth.
Related to that, many women stop taking medication for mental health conditions during pregnancy and when breastfeeding because they are worried that it may harm their baby. That can safely occasionally have very tragic consequences, if that causes a major relapse in their mental health condition.