It's a pretty huge question due to its generality, but at that level, it's probably safe to say most things can produce problems in excess. The only specific
things you've mentioned are anxiety and perfectionism as far as I can tell. More specifics would help generate clearer answers, but @Prasanta's is good for anxiety, and your intuition resembles theory (if not necessarily reality) about the relationship between perfectionism and obsessive disorders.
More broadly, I recall reading a chapter (not sure which, but I'd guess it was David Buss') in John, Robins, and Pervin (2010) that argued personality traits in general tend to vary naturally because this increases the adaptive versatility of the society that contains individuals with different talents, responsibilities, and not all the same vulnerabilities. This is similar to the immunological theory that if all members of a species shared the same vulnerability to a certain pathogen, that pathogen could wipe out the entire species if it arose and spread. Individual differences protect the species (or the society) by increasing the likelihood that some individuals will be resistant to sudden selective pressures and survive in the case of catastrophe. The principle also works at less extreme levels of pressure: e.g., having some individuals high in neuroticism may improve the society's responsiveness to subtle, looming dangers that necessitate preventative effort well before the danger takes consequential effect. For example within this example, people who worry excessively about government conspiracies help ensure that the rest of us don't grow complacent about a lack of transparency in governmental functions. In a more evolutionary context, hypervigilant worrywarts would tend to help protect their neighbors from predators.
Given these selective pressures at the societal level that promote variation, some outliers may arise naturally. Even though neuroticism tends to be psychologically unhealthy, neurotic individuals may adapt optimally to certain circumstances, especially threatening ones. In this sense, "excess" depends on context: many excessively strong traits in normative contexts may be adaptive in rarer contexts. It's even conceivable that in certain circumstances, one could be excessively average! E.g., if a socially polarizing issue divides people into violently conflicting groups, having no strong leaning could endanger moderate individuals by making them misfits in either polarized group, especially if group protection is crucial. Such scenarios are probably applicable to a minority of selective pressures though, so your intuition about polar extremes being more problematic is probably more generally applicable, if somewhat unfalsifiable.
John, O. P., Robins, R. W., & Pervin, L. A. (Eds., 2010). Handbook of personality: Theory and research. Guilford Press.