Back when I worked at Google there was an internal page someone put up that denoted what they called "the YX problem": the observation that the XY problem, applied to a sufficiently great extent, creates an environment where more productivity is lost convincing one's interlocutor that X is in fact the correct problem to solve than would be lost by chasing X and having to later pivot to Y if that turned out to be wrong.
It's extraordinarily aggravating when it happens. I really wish it was something we talked about more.
This is the right way to answer these questions. SO was famous for the infuriating "You shouldn't do X, so as a favor to you I'm not going to tell you how." or "Before I answer thee, thou must first answer me these questions three!" kinds of answers.
Edit: Don't want to take credit for this. It's a quote from the article.
Ultimately, it should be on me to choose whether I want to risk doing X or whether I want to take up your offer to explain Y, not the "as a favor to you, I'm not going to tell you how" way you described.
The desperation for commodity services and second-tier products to stay relevant is widespread. See also intercom.com "The only helpdesk designed for the AI Agent era".