Trait diversity is traditionally seen as promoting species richness and ecosystem function. Species with dissimilar traits would partition available resources, increasing niche differences, facilitating coexistence and increasing ecosystem function. Here we first show, using theory and simulations for light-limited phytoplankton, that combing photosynthetic pigments is indeed a necessary condition for coexistence and stimulates ecosystem function. However, pigment richness does mostly not permit the coexistence of more than two species, and increases productivity at most 60% compared to single-pigment communities. Surprisingly, combining all nine pigments known to date leads to a 2.5% probability that four species would coexist, illustrating that the coexistence of a high number of species along a continuous niche axis is constrained by limiting similarity. We explain these constraints by unimodal effects of pigment richness on niche and fitness differences, which jointly limit the positive effect of pigment on species richness. Empirical data and additional simulations suggest that pigment richness effects can be stronger during transient dynamics but inevitably weaken with time, i.e. pigment richness effects on species richness and function are likely short-lived. Our results highlight the need to apply coexistence theory to understand the long-term effects of trait diversity on biodiversity and ecosystem function.Statement of authorshipJ.W.S. and F.dL. developed the ideas and wrote the manuscript. J.W.S developed the mathematics and the python code to conduct the study. J.W.S conducted the literature review.