I don’t think anyone was under any illusions. Britain didn’t have a choice or any leverage. It was a 99 year lease so there was no legal claim to keep HK and the UK wasn’t going to war with modern China. China could have just taken it if Britain set a bunch of terms.
Before the handover, they just basically offered Hong Kong residents the right to move to England. Canada, Australia, and the U.S. had special rules for immigrants from HK. (Probably other countries too.)