Most animals undergo ontogenetic niche shifts during their life. Yet, standard ecological theory builds on models that ignore this complexity. Here, we study how complex life cycles, where juvenile and adult individuals each feed on different sets of resources, affect community richness. Two different modes of community assembly are considered: gradual adaptive evolution and immigration of new species with randomly selected phenotypes. We find that under gradual evolution complex life cycles can lead to both higher and lower species richness when compared to a model of species with simple life cycles that lack an ontogenetic niche shift. Thus, complex life cycles do not per se increase the scope for gradual adaptive diversification. However, complex life cycles can lead to significantly higher species richness when communities are assembled trough immigration, as immigrants can occupy isolated peaks of the dynamic fitness landscape that are not accessible via gradual evolution.