Then theory Y suddenly appears. Theory Y is new, and has lots of unexplored areas that you have the skills to work on. You don't believe in theory Y, but you could make a useful contribution to theory Y in your research...
If you are an ambitious economist, especially an ambitious young economist who needs a thesis topic or publications, you would have a very strong incentive to do your research on theory Y. Even if you weren't ambitious, and just needed something to work on to stay busy, or needed to publish anything to stay respectable, you would have an incentive to work on theory Y.
In the late 1970's, rational expectations was theory Y. As a young graduate student, I did not think that this theory was going to answer any important questions in macro, so I refused to join the fad.
I have never held a tenure-track position in any economics department. I had my dissertation completed when I went on the job market. Several of my colleagues had barely started, but since they were doing rational expectations they got respectable job offers.
If it were not for the Internet (a phenomenon that was not in my imagination in 1980), my visibility in economics would be exactly zero. So the pre-Internet moral of my story would be that you have to suck it up and do research in areas that you think are garbage, unless you want to be self-marginalizing.
Having said all that, my bitterness toward academic economics and its fads has limits. Had I been successful in academia, I would not have had non-academic experience. And I would have much worse understanding about how business works in the real world. I would have less economic insight.