See the following articles for the historical context :
"Even in the '60s and '70s, the Foreign and Commonwealth Office in London attempted to introduce democracy and free elections only to be told by Beijing, including by Prime Minister Zhou Enlai, that under no circumstances would [China] tolerate a democratically elected Hong Kong because they saw that as the first step toward independence," she said. 
"These documents … show that not only were the Brits mulling granting Hong Kong self-governance in the 1950s; it was the Chinese government under Mao Zedong who quashed these plans, threatening invasion." 
Meaning Hong Kong would technically no longer be part of China, and would revert to British sovereignty.
Meaning, if they pass this law and take over defense/security in HK, they are essentially violating the Hong Kong Basic Law (Constitution) and invading what would then be (through their actions) a foreign country.
Defer to international lawyers on the technicalities, but that's how I've seen this read.
Note that Hong Kong was given to the Britain by three treaties in the 19th century (1842 Treaty of Nanking, 1860 Convention of Peking, 1898 The Second Convention of Peking), and the true copies of all treaties are in the hand of Taiwan, which were brought to Taiwan by the KMT government during its retreat to Taiwan before 1950.
So if the 1984 Sino-British Joint Declaration, the declaration behind the handover of Hong Kong from Britain to China, is revoked (partly because CCP declares it invalid), Britain might declare that Hong Kong should return to the holder of the three treaties–Taiwan.
Extremely unlikely, but arguably has legal justification.
So the issue is: who represents China? The government in Beijing or the government in Taipei?
Later, Britain signed the Sino–British Joint Declaration of 1984 with Beijing to decide the (then) future of Hong Kong. If the Sino–British Joint Declaration is revoked, things could be different.
Just recently US is asking the Beijing government to repay the debt of Qing dynasty , which Beijing said would be the responsibility of Taiwan. Following this logic, receiving Hong Kong from Britain could also be the responsibility of Taiwan.
Since 2001! There's a century of this debt getting rolled over to greater fools.
Having said that one must note Taiwan has a law in the pipeline (1st reading) to give up The claim of mainland. You may be surprise Of communist china Actual objection To it But not HKER or Taiwanese. In any case Even if they keep the claim This path is Only valid In theory but frankly not in Practice.
Personally i will continue our fight. Taiwan has enough of their own problems. If they can free from mainland, That is great already.
Sure. In that case, it would revert to British sovereignty, Britain wouldn't lift a finger to defend it, and it would go to China anyhow by right of conquest.
Treaties are nifty and all, but ultimately, no matter what pieces of paper are signed, you can't hold territory you have no intention to defend.
Gives legal pretext for any tariffs or sanctions you want, meaning we are at the beginning of these issues not the end...
If Beijing were able to control the fate of Hong Kong in the 1950s, they would have, and it wouldn't have been "leave it in british hands, sure, as long as there's no democracy".