I don't get why they sold it. If the Chinese government really had a say, simply refusing would have been a better option, as Trump would have never dared shutting off an app loved by hundreds of millions of voters.
The definitive factor here is whether the Chinese company wants to put themselves deep in the American political water. To any company, living under a crosshair alone is difficult enough, it becomes even more so when the company is foreign-owned.
The sell was a strategically correct decision by ByteDance, they made money out of it and they secured some future income, at least for a short while. But no app or service lives forever anyways, so it's still a good trade.
Whether or not the sell could benefit actual American users was never mattered.