At most, I’d say untreated/poorly treated mental illness removes any filter a person has... but you are 100% right, it will not create bigotry out of nowhere. Equating racism, misogyny with mental illness is akin to saying everyone thinks those horrible things, and once the filter is out, it is out.