Herbivorous insects can escape the strong pressure of parasitoids by switching to feeding on new host plants. Parasitoids can adapt to this change but at the cost of changing their preferences and performance. For gregarious parasitoids, fitness changes are not always observable in the F1 generation but only in the F2 generation. Here, with the model species and gregarious parasitoid Anaphes flavipes, we examined fitness changes in the F1 generation under pressure from the simulation of host switching, and by a new two-generation approach, we determined the impact of these changes on fitness in the F2 generation. We showed that the parasitoid preference for host plants depends on hatched or oviposited learning in relation to the possibility of parasitoid decisions between different host plants. Interestingly, we showed that after simulation of parasitoids following host switching, in the new environment of a fictitious host plant, parasitoids reduced the fictitious host. At the same time, parasitoids also reduced fertility because in fictitious hosts, they are not able to complete larval development. However, from a two-generation approach, the distribution of parasitoid offspring into both native and fictitious hosts caused lower parasitoid clutch size in native hosts and higher individual offspring fertility in the F2 generation.