If this were true, then treating any question as an X-Y problem shouldn't be allowed at all. I.e. answers should at least address the question as posed before/instead of proposing an alternative approach.
In reality the opposite is encouraged. For countless times, I've landed on questions with promising titles/search extracts, only to find irrelevant answers because people grabbed onto some detail in the question irrelevant to my case and provided X-Y answers.
This often also causes subsequent useful questions to be marked as dups even though they no longer contain that irrelevant detail. The appeal process is so unfriendly that most would not bother.