I seriously doubt that China would already be phasing out the DF-21D within a time-frame as short as 20 years. As you said, the DF-21D is an asymmetric weapon meaning that China is only resorting to it because their navy is no match for the USN and they need a weapon system that compensates for that inferiority, at least within 3000km of the Chinese coastline.
With that being said, the only reason China would feel confident enough to phase out the DF-21D would be when their navy is no longer inferior to the USN, both quantitatively and qualitatively; that is certainly not going to happen in the next 20 years. As astonishing as the speed of the PLAN modernisation is, it will be pushing the boundaries of reality to think it's possible for China to build and amass a navy nearly as huge and advanced as the USN within 20 years. I have doubts that it can be done even after 50 years. With an inferior navy that's probably going to stay inferior for the foreseeable future, the Chinese need to rely on the DF-21D (or a similar weapon) if they wish to guarantee the absolute safety of the Chinese coastline from potential US or US-led attacks.
Hence, I believe the DF-21D (or something similar) will remain in service until China is confident of the superiority of their navy relative to the USN, which as I mentioned above, I believe is unlikely to happen for many decades to come.
I think you're making an assumption here that in order to phase out a weaponry like DF-21D, China will need a navy as large and as powerful as USN. That's certainly not what I meant or agree with.
DF-21D is a A2/AD weapon/platform whose purpose is to push USN's CVGs farther out from Chinese shores, say 1,000 - 1,500 km away, such that the tactical aircraft on these carriers are not an effective threat to China should a conflict between US and China occurs around China's peripherals. DF-21D is not a global domination platform, not by any stretch of imagination.
In 20 years, it is reasonable to expect China would fare a carrier force of 4 - 6 carriers. With both land and carrier-based aircraft, it's not unreasonable to expect China will achieve some measure of air superiority around her, say 1,000 - 1,500 km away from the mainland. That, plus the improvement of ASW capabilities and all kinds of ballistic and cruise missiles and the full-fledged space based C4ISR assets, will go a long way to feel relatively secured around her peripherals. This is far from faring a navy matching USN in quantity and quality, but that wouldn't be necessary. The curse of geography, if you will. These kind of force structure is much more preferable than investing in a platform like DF-21D, given the fixed pool of funding. And this was my point.
It is easy to get off-track from this point of discussion and wade into the US China global rivalry. I think it's far from per-ordained that US and China would end up in a fierce struggle for global domination. It would be a tragedy of gigantic proportion for both nations and the world should that happen. In fact, today China and US have more overlapping interest globally than conflict. The competition right now is really limited to Western Pacific. Both Americans and Chinese are pragmatic people, I'm cautiously optimistic they will, eventually, find a way co-exist with each other. Because it's simply in both countries' best interest. But that is another topic.