The GDP size is now among the least valuable aspects of Hong Kong as it pertains to China. That has never been primary.
Hong Kong is the economic staging point that much of the world uses to enter China's economy. Think of it as a translating middleman, that the world uses to convert from foreign market-based economics to China's domestic way of running things as a rigid command economy that is operated by fiat and is often hostile to foreign operators/owners/investors. Hong Kong's role in that respect has been critical to China's economic rise.