There were some things that were unavoidable in hindsight. It couldn't be helped HK residents overall did have a different mindset due to having been under British rule for so long. It couldn't be helped that economically and in terms of living standards Mainland only recently caught up, so the residents had an ingrained superiority complex. And above all, the main driver of discontent which was the city's property values, which certainly couldn't have been helped not least due to the understanding the city was a part of China but "self-governing."
About the only area of discontent that could've been mitigated in my view was the misbehavior of Mainland Chinese tourists to the city. But in the grand scheme of things, as stated earlier, there was an understanding Hong Kong was to be left to its own devices despite being nominally a part of China. The discontent festered until rebellion broke out and that's just the shitty reality of statecraft, every big state no matter how tight of a grip they have on things has to deal with outbursts of discontent every once in a while.
In which case the main area that deserves scrutiny is how the discontent is dealt with and I'm sure the accepted narrative is that at first it went very poorly especially with the defeat of pro-China candidates in the district councel elections and then was quickly squashed with the NSL. Now China's in firm control, the leaders of the HK movement are either incarcerated or abroad, and the city is back to normal. So that's that, time for bigger fish to fry.