This is plainly false. China bought the refining companies doing the extraction for rare earth in the US, extracted knowledge, then shipped the tooling to China and closed the US factories. Having no environmental regulation probably helped as well cost-wise, but that's not the fault of the USA.
https://www.counterpunch.org/2006/04/07/the-saga-of-magneque...
That article doesn't say anything about selling a mine, it says the only mine was already in China. China bought an American magnet manufacturer which had been using Chinese neodymium to make magnets. It doesn't say anything at all about extraction.
Also, nobody forced US companies to sell those assets.