Programming is an intense job, in that it takes a lot of focus and time to build up a mental model of what you're working on to make progress
Not weighing my time and effort into the equation is rude on behalf of the asker.
What really happened is, you context switch, answer a mundane question, and now spend 30 minutes to get back to the mental state that you were in that made you productive
It’s important to not make everybody do your research for you, but what you’re describing is not at all typical.
If this is not typical for you, then you are surrounded by people who disrespect you and your time.
You aren't going to be able to convince others to be upstanding coworkers that actually give a damn, but you can be that person yourself.
not rude. not implying anything about the questioner. still the general sentiment of "google it; that's not my job". if you admonish people as being "incredibly rude", you should be talking about things that people actually do with enough regularity to make the point worth making. that is pretty widely understood.