Depends on if they are common or not.
Common enough to be a playable race. Also, really? Orcs, the most iconic of villains? And you want to play the "they might not be common" card? They are stock humanoids.
The troll regeneration debate happens for a reason.
And Trolls are not vulnerable to fire or acid, so this ability has nothing to do with their Resistances (none), Immunities (None) or Vulnerabilities (None). So, am I metagaming if I assume a troll has no resistances, Immunities or Vulnerabilities?
Are you serious right now? Elf is in the PHB. Human is in the PHB. Knowing that they don't have any R's, I's or V's is not metagaming. Heck, you can't even use the "how common are they" because the answer to how common humans is is "Yes". They are the single most common creature in the entire game.
You can't stretch this metagaming argument that far. No one would consider knowing about humans metagaming.
Depends on the creature. How are you supposed to know that a Magmin is resistant to those things? A mace can crush rock, why would you assume that a rock creature would be harder to hurt than a rock?
I don't know Max, why might I assume a creauture made of MAGMA (a fluid) might be difficult to smash or cut. I'll also go out further on a limb and guess a creature made of MAGMA might not burn. Wild guess, but it seems kind of logical.
Maces can crush rock? Sure, but you can also crush a rock creature. Resistance =/= immunity. Why would I assume that my mace is going to be equally effective against a fleshy sack wrapped around bones with vital organs floating inside as it is going to be against a solid piece of rock? Have you ever actually taken a one-handed hammer and tried to smash a solid piece rock? You chip it, but you certainly don't do to it what you can do to an arm or a ribcage. So, why am I not allowed to assume my weapon is going to be less effective?
Oozes have no functioning organs and are not immune to poison.
And they eat. They are like Jellyfish. They do have a functioning digestive system. Skeletons don't. Zombies don't. Animated suits of armor don't.
Also, let's say that my character assumes oozes ARE immune to poison. Is that meta-gaming? Am I going to get called out for not using poison on a creature I incorrectly assume is immune to it?
Yep. Why immune and not resistant?
Because it shoots ice from its eyes and lives in an icy environment. Why would I assume it still takes damage from the cold? I don't assume that creatures that live in volcano's take fire damage, why assume creatures that live in ice caves will take cold damage?
Why is the shadow different from a wraith, which looks like it is also made out of living darkness?
I don't know, are they different? Am I going to get penalized for assuming that the Wraith is vulnerable to radiant damage because it is an undead and ethereal and made of living darkness?
Do you know how commonly people assume undead, the enemies of clerics, are vulnerable to clerics signature damage type? Should I accuse all of them of metagaming when they are wrong? Does it matter if they are wrong?
No. Why would you be? I will repeat, "The PCs need to know, not just the players." and in your example above, they do.
Right, so when the PCs learn it once, they learn it forever. How useful is an ability that is only needed once? We generally call that "niche" right?
Yes. Those are not demons. That's like saying that just because a frost giant is immune to cold, so is a storm giant. Hell, it's even worse than that since at least both of those are giants. Demons are not weak to silver by the way. Devils are. Assuming can get you in trouble when you are trying to assume things about different races.
This is also not about assuming. Using player KNOWLEDGE involves no assumption.
Why would someone assume that a Giant living in the Tundra and covered in ice is going to be the same as a giant living underwater and throwing lightning bolts? Hey, I bet the guy who can summon and throw lighting as just a natural part of his existence doesn't take full lightning damage.
Also, they may not be demons, but they are extraplanar beings of pure evil, formed in the lower planes. That seems like a really similiar thing. Kind of like how orcs and goblins and humans and elves are all humanoids from the material plane, and all lack natural resistance to fire, cold, and lightning.
Also, what do you mean that assuming can get me in trouble? Is attacking a Demon with a silver weapon going to cause me to explode? No, it just... won't be as effective as I thought. Oh no! That would mean... well, since I had to go and silver my weapons I probably didn't have access to magic weapons. So at worst that just means I spent money on an upgrade that doesn't help. How is this bad? I guess I could have spent the money on something else, but it wouldn't have been anything that helped in the fight.
And, now I know, in-character and forever, that demons aren't vulnerable to silver. So it will never be something I go and do again. If I don't have my next character in a new campaign go and waste money silvering my weapons against an enemy that isn't vulnerable to them... am I meta-gaming? Are players who never assume Demons are vulnerable to silver meta-gaming when they don't silver their weapons?
This is objectively wrong, since I've played at many tables that are like that. In fact, I've played at no table that allows you to use player knowledge to get by resistances, immunities or exploit vulnerabilities without the PC knowing or having a very good in character reason for it.
So... "this creature is made of fire, therefore I'm not going to hit it with fire" isn't a very good in-character reason?
"We've fought extraplanar entities from the Lower Planes before, and poison didn't affect them so I don't think it will work this time" isn't a good in-character reason?
"They are just goblins, they don't have resistances, they are just people." Isn't a good in-character reason?
What counts as a good in-character reason then?
I don't see why the DM would gimp a player on knowing those vulnerabilities, just because they aren't listed as a vulnerability in the sense that they take extra damage. A troll is vulnerable to acid and fire, because it stops his regeneration.
Ah, so you want to cheat. If an ability says that it tells you Vulnerabilities, then it doesn't mean you get to learn their special traits. It means you get to learn their Vulnerabilities. Of which trolls have none.
If you want to have an ability that does tell you their special abilities then we are talking about something completely different. I've actually advocated for the Ranger's new Hunter's Lore ability to basically give the player the monster's statblock. Learning AC, HP, special abilities, average damage, Vulnerabilities, resistances and immunities IS actually useful, because that information changes and is useful every fight.