This was a joint agreement between two sovereigns. You’re correct to say that it’s within the power of a sovereign to reneg on their word, but it’s a violation of international law and the UK would have every right as a sovereign itself to seek redress through whatever means it deems appropriate.
Except they had an agreement for 50 years to keep it that way. So basically what you mean is anyone can change their mind, which means agreements aren’t worth the paper they’re printed on.
> Agreements aren’t worth the paper they’re printed on.
Pretty much. They are only as effective as the body trying to enforce it. The entire point of being a sovereign nation is nobody can force you to do anything. Now it is in a nation's self interest to not violate agreements and get along nicely, but sometimes the calculus changes and the punishment may not outweigh the benefits.
I don't really like what China did with Hong Kong, but some things you surely agree transcend 'contracts' or normative behavior. I can't, for example, agree to be murdered in exchange for money. I might also lie to protect my children from the local murderer, or in any other case where I'd consider the outcomes 'extereme'.
Not saying I like what they did (I don't).