Open source is not to blame here. AI companies used the code, in some cases against the license, to train their models.
Nobody is actually getting replaced - it's just that layoffs are in vogue now. If there was productivity to gain here, it would be used to do more and capture more of the market.