This is an oversimplification. One should of course take great care not to use generalizations to promote group-based hatred, but this is in addition to the fact that it would be naive (and impossibly restrictive) to declare nationality generalization forbidden. Nationalities, cultures, and many other set-formings of humans have salient features, on average, for better or worse.
Acknowledging the nuance on this issue is hard, because a lot of people will call you a literal nazi for doing so. But that is a position which, ultimately, entirely denies the existence of culture as a concept.
You’re ignoring the context of my comment. They’re implying that Indians are second-rate engineers, not that they have a cuisine that uses lots of spices.