I refer you to Mark-Jason Dominus's original explanation of what X and Y had to be. It got renamed "XY Problem" after the fact, and that name didn't take off for a long time, really not until Stack Overflow appeared and became popular, well over a decade after MJD posted about this and well after many of us had for that time not been calling it this on volunteer-support mailing lists and Usenet newsgroups.
* https://jdebp.uk/FGA/put-down-the-chocolate-covered-banana.h...