If ByteDance sells TikTok to US owners to satisfy the requirement, they give up control of a successful platform developed inside of China to a self-declared adversary that already controls most of the world's social media platforms, representing a significant loss to China as they attempt to compete online.
If ByteDance ignores the demand to sell, the US government has obligated itself to prevent its citizens from accessing one of the most popular social media apps in existence, something that the affected users will be extremely angry about, and will likely make claims of state censorship.
If I were China, and my goal was to leverage TikTok to do harm to America, I would choose the option that turns US citizens against the government over the option that transfers power from China to the US.