Well I’d assume in this situation and this “male person” identifies as female and likewise could be facing safety issues in male toilets considering they identity as female.
Two separate issues here.
First: They may identify as women but they are male, not female as no one is able to change sex. Female is a biological reality and not an identity, and sex remains relevant. While some people base perceptions of others on gender expression, others do not share that belief and perceive based on sex. Obviously mutual tolerance is necessary.
Second: TW may well not be safe in male spaces, and absolutely no one should have to be vulnerable in a space where their privacy and dignity is affected and they feel unsafe. However this does not automatically mean that the only solution is that they use the female single sex space. Third spaces would meet the need without removing single sex spaces from female people. There are many other male people unsafe in male spaces: female spaces and femalehood isn't the refuge for anyone not safe in male spaces. Those spaces are to meet the needs of female people.
Can you give more information on how exactly this person attending toilets that match their gender identity excludes some females accessing facilities? I’m obviously not aware of these issues in as much depth as you are.
Women whose faith and culture means they cannot access mixed sex spaces regardless of how someone identifies, women with disabilities such as Autism, women with a history of trauma and sexual assault, women whose dignity, privacy and comfort to partially undress (as women have to) is too affected to be able to use mixed sex spaces for situations where they are undressed and vulnerable.
As I said above, absolutely no one should have to be vulnerable in a space where their privacy and dignity is affected and they feel unsafe. Solutions have to be found that don't involve telling those women they either prioritise the needs of the male person or lose access to any space. It cannot be only male needs and feelings that are valued.
Solutions have to work for everyone.