And yet, it could just be a single race of elves that ranges from magical-kingdom-builders to nature-loving-rural-folk, just like humans range beyond just one particular personality/talent across the entire race..... Elves could just be the general, inherantly-magical-and-good-with-spells race. But instead they need multiple kinds of elf.
Gnomes could just as easily fit different niches, since there are different kinds of gnome in different settings. Even so, the smart, clever, and mischevious gnome archetype is fairly universal (except for Dark Sun, what with its lack of gnomes, but that's cuz it's supposed to be a grimmer setting).
Whether they ply their wits as inventors, wizards, tricksters, sages, keepers-of-secrets, or manipulators, depends only on the setting. They could still be the iconic knowledge-hoarding race, with racial talents for deceptive magic, trickery, and information gathering.
Heck, if the designers wanted to, they could make elves the magic-race and gnomes the earthy nature-lover race. Or the reverse. They could play up the creepy troll-like aspects of gnomes from folklore if they wanted to. Just like elves, gnomes have a few different mythological/folklore/fantasy-fiction origins.