It’s very unlikely that the deal says “we will buy everything you sell us no matter what.” It’s probably a typical purchasing agreement with tolerances and QA, just paid in advance.
Thus there is still a lot of risk being taken on by the fabs. The production could go sour, geopolitics could change, resources might be unavailable, etc.
The purchasing companies are externalizing all of this risk by purchasing the products instead of the company.