That is not actually what that article says.
It’s a common pattern to say ‘company X laid off thousands of employees but then applied for thousands of H1B visas’ which very much gives the impression that the company has just fired a few thousand Americans and hired a few thousand foreigners.
What actually happens is: a company has a global workforce of 100000 or so. 50000 of them are in the US. 5000 of them are in the US on H1Bs, 45000 of them are Americans.
Company does a 10% layoff: 4500 Americans, 500 people who are in the us on visas, and 5000 people around the world.
Headline: “Company X lays off 10000”
Then the H1B renewal numbers come out and what do you know company X is applying for 4500 H1Bs, to retain their existing H1B staff who weren’t affected by the layoff.
Headline: “After laying off 10,000 staff company x applies for 4500 H1B visas”
Unstated in such a headline: 5500 of those layoffs were foreigners; the company still employs 40500 Americans.
To bring it back to your point: you cited this article as evidence for the claim that Microsoft laid off ‘thousands of domestic employees’; the article does not say where the thousands of layoffs were and explicitly contains a quote from an MS spokesperson that says “H-1B employees were also impacted by job eliminations in the U.S.”