Wearing forbidden clothing could invalidate one's prayer
Question: A woman uses a particular clothing for prayer and it is clothing for men. Is her prayer permissible? Is this considered part of imitating men?
Response: If the clothing is something particular for men, then it is forbidden for her to wear it regardless of whether she is praying or is outside of the prayer. This is because it is confirmed from the Prophetﷺ that he cursed those women who imitate and appear like men as well as those men who imitate and appear like women. It is not allowed for a woman to wear clothing that are particular for men and it is not allowed for men to wear clothing that are particular for women.
However, we must understand the concept of "particularity". Particularity is not with respect to color but it is with respect to color and description. It is, then, permissible for women to wear white clothing as long as it is not the same as the white clothing of men. If it is clear, though, that woman wearing men's clothing is forbidden, then her prayer in such clothing is not valid according to those scholars who say that the covering in the prayer must be a covering which is permissible.
This is a question in which there is a difference of opinion among the scholars. Some scholars say that it is a condition that the covering or clothing be clothing that is in itself permissible. Some do not lay down such a condition. The proof for those who lay down such a condition is that the covering of the aurah [what must be covered] in the prayer is one of the conditions for the prayer and the covering must be something that Allah has permitted. If it is something that Allah has not permitted, then it is not considered a legal covering since it goes against what is commanded. The proof of those who say that the prayer is still valid while the person is committing a sin is that the woman has actually covered herself and the sinful aspect is something that is external and is not particularly related to the prayer. In any case, the person who prays in forbidden clothing is in a dangerous situation since her prayer may be rejected and not accepted from her.
Islamic Fatawa Regarding Women - Darussalam Pg.129-130