Not completely that - Legally, Britain couldn't actually do anything because they'd be in the wrong if they didn't hand back the portion of Hong Kong that was leased to them for 99 years - Taiwan seems a different case, because they interpret themselves as the "One China", while with the British they actually acknowledged the 99 year lease (China's military strength definitely played a role, especially when they informed Britain they would not renew the lease - but legally, the British had no true recourse and everyone knew it). They really tried to see if it was possible to hold onto only the land that was ceded to them permanently, but ultimately it was too difficult and unfeasible (and also, China could simply roll in with its military - as they did allude to at the start of negotiations - but we never reached that point, and I believe would have created a situation similar to one we would see if China invaded Taiwan). China did not yet have the economic strength. Military strength, yes, they had enough bodies (and nukes) to take back Hong Kong. Ultimately, everyone realized that splitting Hong Kong in two was not possible and China had every right to take Hong Kong back - but China wanted to make sure to do this in a way that showed the world they were developing and moving forward - otherwise it would have spooked foreign investment.
China during the 90s was still a rising superpower and Hong Kong equated to 10-15% of its total GDP - and the sanctions that the rest of the world could wield upon them could have definitely blocked their industry expansion. The meteoric, exponential growth was only just beginning - and would have been stopped right in its tracks. The world would go somewhere else for cheap labor - China had not moved up the value chain yet at that time, so the possibility for sanctions and the end of all foreign investment in China was very real and would have had massive impacts. (Not saying sanctions on China wouldn't work today, but they would hurt the countries doing the sanctioning a lot more)
Nominal GDP of different countries by year: (look at 1997)
View attachment 3253
The other SAR, Macau, was ceded indefinitely, but China used a grey tactic - starting riots during the Cultural Revolution that the Portuguese were unable to control, which forced them to negotiate secretly and gave China de-facto control, and it was eventually returned (the Portuguese also wanted to return it earlier, but that's another story).
The Taiwan question has different interpretations of the One-China policy, that allows for legal ambiguity. The Hong Kong problem was very clear and laid out. Everyone agreed that you had a 99 year lease that was expiring. The British even acknowledged it when they first went to Beijing to get an extension. The ROC and PRC claim different things about who is the "One China".
We still have 11 countries and the Holy See recognizing Taiwan as the "One China". It certainly helps that there is a large strait between Taiwan and China, that Taiwan has a military that would fight back, Taiwan is the center of semiconductor manufacturing, and the US have a defense treaty with them.
I do wonder how things would have played out if Hong Kong had a 150 year lease - would China try to take it back early? I do think so, though they would try to use different justification (false flag attack, maybe), and be forced to use military and economic means - but it definitely could leave a bad taste in everyone's mouth (Hong Kong before the 90s was partially free, but not democratic - though the people there appreciated the additional freedoms they had over China - and I do wonder whether and when the UK would have actually initiated a democratic transition if there was a 150 year lease) and cause a whole lot of headaches - and in this universe, I think it would completely prevent them from taking Taiwan, who would invest even more heavily in their military after seeing what happened.
New Terrortories was 99yr Lease.
Hong Kong Island was forever.
It was returned as what was the point of keeping it?
The UK Taxpayer wasnt gonna support funding it thats for sure.