If ByteDance doesn't want to sell their stupid algorithm, they could simply rip it out of TikTok, replace it with a random number generator or any other off-the-shelf recommendation engine, and proceed with the sale.
Find their lowest paid summer intern from the university computer science department, tell him to write some sort of recommendation algorithm and he has two weeks to do it, then whatever he comes up with make it live and that's all the new owner gets.
I doubt the recommendation algorithm is particularly special, the userbase is the more important thing IMO. However, any purchaser would need to implement something decent if they want to maintain that userbase.
It's like Twitter. Yeah, it lost a bunch of value when Musk gutted it, but it's still relevant today. So if someone less hostile to the core userbase buys it, I don't think some growing pains from a change in algorithm would kill it.