Answered by Shaykh Amjad Rasheed
Is it permissible for a woman to stand next to her mahram (unmarriageable men) during the prayer?
Yes, it is permissible for them to do that, but there is offensiveness in it. In our school, neither the woman’s nor the man’s prayer would be invalidated thereby.
الجواب : نعم يجوز ذلك لكن مع الكراهة ، ولا تبطل صلاةُ الرجل ولا المرأة بذلك عندنا