In those cases, if you do the "looking at your context, did you mean Y instead of X" substitution, your answer will be still attached to a "how to X" query, and will frustrate a lot of people who may have a legitimate reason for doing X.
In those cases, if you do the "looking at your context, did you mean Y instead of X" substitution, your answer will be still attached to a "how to X" query, and will frustrate a lot of people who may have a legitimate reason for doing X.
If you really do need to do X, then explain why clearly in your question and you'll likely get an answer for it. And of course SO allows multiple answers, so we can have both the technically correct and the not technically correct but still useful answers.
And, conversely, it will help a lot of people who may not realise that their desire to do X instead of Y is flawed.
So, when you notice this happens often and it annoys you, ask better questions. Explain what you want to achieve, what you considered and why you discarded certain solutions whilst you know they are common. If you get a substition beyond all of that chances are the person answering knows what's up. Embrace it, see why it is proposed and simply take time to explain why you couldn't use that (or can). It takes a few minutes but the person answering is spending more than you are, for free. Also you help every next viewer of your question.