The party he founded and its successors and allies, as well as many of those who opposed the 2003 national security were all the obvious warning signs Beijing needed.
Even pro-CCP politicians like those in the Liberal Party opposed the 2003 national security law. The problem was that, much like the current legislation, it was vague and not tightly worded enough to avoid potential abuse by the HK government in suppressing political opposition. When even someone's political allies are saying something's wrong, they really should pay attention and have a rethink, rather than assume opposition is because of prejudice or hatred.
As for the Democratic Party, you seem to be implying that the only way to get the CCP's trust was to ensure that the only mainstream parties in HK were overtly pro-CCP. That's like a parent saying
"you're free to decide what after-school hobby you do, so long as it's what I want you to do".
Sure, Martin Lee didn't trust the CCP early on and he generally thinks China would be better served by improving its human rights and political freedoms. But that isn't anti-China or even necessarily anti-CCP - it's a difference of opinion of China's political future. If the CCP thinks anyone who talks about a future where China has a gentler and more open political system is their enemy, they're being irrational.
Also, arguably it served CCP interests to have a central pro-democratic party like the Democratic Party rather than lots of parties potentially demanding different (and radical) policies. Don't forget, the DP negotiated with Beijing in good faith and agreed to the very limited 2010 HK political reforms, despite the fact it annoyed many of their supporters, because it was willing to trust the CCP and wanted to show it was an honest stakeholder.
The 2010 reform package passing should have shown the CCP that it could work with the DP. But instead of taking the goodwill offered by the DP, the CCP appeared to congratulate itself that it had "split" the pan-democratic camp and conclude it was "winning" an imaginary battle in Hong Kong. It then offered the joke of reformed Chief Executive elections where it would get to pick the candidates, presumably thinking it could split the pan-democrats again and make them fight amongst themselves, whilst its supporters could keep ruling HK. The plan backfired.
Again, rather than sit down and wonder if it had made a bad decision by offering something that was so bad it eventually failed, the CCP doubled-down and blamed everyone but itself.
As for media entities, obviously I'm referring to Jimmy Lai.
In the mind of the CCP, one wealthy HK person being in support of the pro-democratic faction and owning a newspaper outweighs all of his peers who are pro-CCP and also own newspapers/media outlets and have votes via the Functional Constituencies? Really?
We're returning to the scenario that the only way to get trust from the CCP is to be totally loyal and just do what it wants.
If China had not been as restrained as it has been and if Hong Kong's movement did not have all of the political and media support of many of the world's other leading powers providing rhetorical support out of hostility to China, then I might agree with you.
HK's international support doesn't make up for the vast disparity in power, not least given how proudly the CCP (and people on this thread) have paraded support for China's position from other countries. (I mean, if you want to tell those other forum members that the support from countries like Saudi Arabia and Venezuela doesn't mean anything, go right ahead.)
The CCP hasn't moderated its recent policies one iota despite international pressure. It simply doesn't care what other countries think. Every time it has suffered some sort of reversal in Hong Kong, it has gone away, sulked and come back with something that is even more objectionable than what it proposed last time. The CCP is not a victim.