Hong Kong was legally going back to China at some point. There was no question of that. China accelerated the process.
I certainly have my own opinions on that, but it’s not comparable to Taiwan.
And you’re right about the UN. They won’t do jack. (Remember China and Russia are permanent members). The United States might (alongside strong allies in the region, but maybe not), however. Taiwan is strategic at this point as a source of chip manufacturing among other things. The Chinese won’t do anything.