iserith
Magic Wordsmith
You've mentioned this technique before and I find it an interesting concept. Do you have a play example or something you've written that would illustrate how you do this better? (Not in relation to knowledge, just the general concept.)
I've probably posted one somewhere, but I wouldn't know where it is.

Basically, if the question a player asks is something the character could DO by taking action in the game world, he or she should take the action instead. (Fictional action not necessarily "mechanical" action.) Asking a question is sort of like cheating in that it's a way to avoid a potential consequence for an action the character takes. It's playing in the "metagame" instead of playing in the game which is safer. It stops the narrative from moving forward until the questions are resolved.
If the question is about a rule or some other issue that cannot be answered by the character taking action in the game world, then that's fine. Otherwise, per the basic conversation of the game, the player should describe her or her character's actions.
As I a player I like to occasionally find myself in those situations. It's not an unpleasant gotcha for me unless it was pulled off poorly. I generally GM the exact same way I want my GMs to do it. This might not be exactly the same as how particular players would like it, but then again I'm an introvert who enjoys spending my recreation time with people as similar to myself as possible, so I'm not concerned so much about appealing to everyone.
On the other hand, some of the telegraphing you're talking about is proper descriptive framework. But if there is no way to tell from looking at it that a mezzoloth is immune to acid, and no player has an appropriate skill, language, race, proficiency, backstory, etc, that would allow them to know that, then I'll let players waste their acid attacks on it until they figure it out. It provides a greater sense of player agency for me, and a greater sense of accomplishment and acquired power (knowledge is power) when they finally learn what they did wrong and don't do it in the future.
The first thing I do when I choose a monster to use is look at its stat block to figure out what things to include in the environment that speak to its special nature. A mezzoloth in my game would almost certainly appear in a place filled with an acidic, poisonous mist or be seen to emerge from a vat of acid to attack. Some other clues might be provided prior to the PCs getting to the mezzoloth's lair. You won't find yourself in a situation where you didn't have a chance to figure this out other than trial and error. That's a "gotcha" in my view and I'm not okay with it.
Further, if a character has no appropriate skill, language, race, proficiency, backstory, etc. that would suggest knowing something about mezzoloths, that means nothing to me UNLESS the player states he or she would like to have the character attempt to recall lore about the fiend. At THAT point, I can say the character automatically fails to do so. But otherwise, I have no right as DM in my view to say what a character believes or how he or she acts, nor judge the player as "immature" or whatever when he or she chooses to use spells other than acid splash or poison spray on the mezzoloth for no apparent reason.