Right.
Which is exactly ALREADY how they determine if ANY person dealing with mental illness can do any of the jobs in the military, including combat. See my PTSD example.
So you seem to now agree with me. No blanket exclusions of any groups of people simply claiming 'mental illness' and instead as you now say 'we have (hopefully) competent people' who will assess the people with PTSD or other mental health challenges and decide whether they are fit for combat or can serve as a cook or other role.
There are a lot of people, who when faced with their first kill of another human or seeing fellow soldiers killed, can never return to combat but can serve in other roles in the military (cook, or other), but a lot more who are assessed and able to return to the battle field, which is why no such blanket declaration that all people dealing with PTSD (mental illness) should simply be excluded.
So again simply saying 'they are mentally ill... thus should not serve' is not enough reason. It must be case by case.