As an enlightened individual, I find the concept of racism to be repugnant. I also find stereotypes are often just dog whistles for racism. But so much of literature depends audiences bringing a lot of assumptions into the story. Stereotypes are really, REALLY useful for that. People love simplifying the world into patterns, and while we know we really shouldn't, we do the same thing with people.
In the Wild West you need the Indians. Space Opera needs the good empire, the bad empire, the secret order of do gooders, and the equally secret order of super-evils.
If I want a Noble Savage as a character, I have to establish that he or she belongs to a distinct culture. That culture has to be judged by the rest of the cast as barbaric.
Likewise, if I want to call on people's expectations of a Proud Warrior Race. There has to be a population of people that conform to those expectations.
Where 19th century adventure stories run into trouble is that they portrayed real cultures as ethnic caricatures. Science fiction sidesteps this issue because they invent entire cultures from whole cloth. I'm in an odd middle ground. I don't have aliens. I can't use existing Stereotypes. (They aren't PC). I really do delight in completely subverting expectations.
My story works with an alternate history, so I do have a little flexibility to rearrange the map and change the labels. So here is a quick list of the Tropes I'm going for and where in the world they come from.
(Space Elves) Lethians. Lethian society originates from roughly where Poland is today. They are the most Magical of cultures, with many still abiding by "The Old Ways". They are victims of multiple invasions, and have finally carved out a new "Homeland" in the Asteroid belt. Lethians consider themselves somewhat more intelligent than other races. Other races look at them as killjoys and cheapskates.
(Noble Savages) Éire. The Éire are another race that is fleeing invasion and economic domination. They originated from the Anglo-Celtic islands, their native land invaded by Vikings and later the Angles. A famine in the 19th century created a diaspora, and many found themselves first on Luna, and later the Belt. The Éire consider themselves God's chosen people. Other races look at them as promiscuous drunks who reject modern norms.
(Proud Warrior Race) Krasnovians. The Krasnovians originate from Viking societies. They are known as conquerors, or less charitably, as pirates. Their culture is steeped in warrior pride, and they treasure defeats as much as they treasure victories. Glory is what drives Krasnovian souls. Of course, when you peel back most Krasnovian Lore you find that most of it is utter retroactive continuity. Their real culture is a mess of Germanic and Russian states who were at each others throats for Millenia.
(Proud Merchant Race) Yankees. The Yankees originate from the East Coast of North America. A breakaway of the British Empire, they built a seagoing nation built upon the idea of free trade and unfettered capitalism. So, after trashing the sea and destroying their livelihood of whaling and fishing, pissing off every empire larger than them, and ripping off every culture smaller, they had nowhere left to expand but space. They are known as brutal negotiators, savage fighters, with every man, woman, and fetus in the mother's womb containing some shade of larceny.