Obviously, the fact the recession started before 9/11 doesn't mean the recession might not have been avoided if not for 9/11. I suspect what we have here is a misunderstanding, on your part, about how recessions work. Recessions aren't just periods of economic contraction. If that were the case, the economy would go into recession pretty much every night, as production largely shut down in the wee hours. Rather, for it to be a "recession," the economic contraction must be sufficiently lengthy. The National Bureau of Economic Research doesn't "call" a recession until many months after what they later name as the start date, because until that point it's still possible for the contraction to be too short (or mild) to get the label "recession." But, once they decide it has crossed that threshold, they back-date it to the first sign of economic shrinkage, rather than to the date when the shrinkage was significant enough to constitute a recession (by which time, the recession may actually be just about over).
You can see what I mean if you read the actual announcement for that recession, here:
https://www.nber.org/cycles/november2001/
As you can see, they didn't call the start of the recession until November 2001 (which was actually the LAST month of the recession). When they made the call, they back-dated it to March. However, they expressly said that it might have been avoidable if not for the 9/11 attacks:
Q: The NBER has dated the beginning of the recession in March 2001. Does this mean that the attacks of September 11 did not have a role in causing the recession?
A. No. Before the attacks, it is possible that the decline in the economy would have been too mild to qualify as a recession. The attacks clearly deepened the contraction and may have been an important factor in turning the episode into a recession.
Now you know. You're welcome.
As for Y2K, the spending associated with preparing for Y2K had started 30 years before 2000 (when software calculating 30-year mortgages needed to be able to handle those digits). By the end of 1999, most of the Y2K work was done (though some continued right up through 2017, oddly enough). So, the idea that somehow that accounts for the growth cycle that continued into 2001 doesn't make much sense.
Besides, if it was that easy to create prosperity, why not just pass a law requiring all programs to be Y10K compliant? That would put all sorts of coders to work, right? But the point is you're taking them away from other, more potentially productive work, which is why nobody would argue in favor of such a law. Well, in the same way, all those computer programmers doing Y2K work were talent not available to do more productive work. What would the Clinton boom have looked like if he hadn't inherited that neglected issue from Reagan and Bush?