Russia sold it to India and sells it to China now, isn't strange? . Anyways my love and respect with China
China bought S-400 back in the 2000s and well before India.
When it comes to military topics, particularly Chinese related ones, there is SOOOOOOOOOOO^n much false information on the english speaking internet. Part of it is emotional fanboys talking out of their asses, part of it is Indian politically motivated fake news, and some of it is just an accumulation of misunderstandings combined with the former categories.
For instance. Did you know that China received full delivery of S-400 before India has even began taking delivery on a single gram of S-400? I bet you heard otherwise. The truth is S-400 deliveries to China have completed.
Did you know that China were in talks with Russia and placed order for S-400 back in the 2000s? Not after India unless it's something we're not aware of. I'm sure India may have had backdoor talks with Russia.
The S-400 isn't really all that impressive but certainly worth studying just like Pantsir was and is worth studying for the US. So much so that the US go out of their way to procure or capture "adversary" equipment whenever and whatever they can. It doesn't mean S-400 is the best and the best China currently operates but it's likely to be way up there if not at the top for the narrow range of purpose it's designed for. The US captured and took home to test some Pantsir S-1 units and in the past many other Soviet and Russian equipment from rifles to missiles to fighters to helicopters and even submarines! This doesn't mean they wanted to copy it. Studying it and learning how to defeat certain things is more than half the value. There's still always the chance you could learn a thing or two worth applying while you're at it.
Okay it's got a great range of capabilities and feature a combination of different individual missiles all a part of the S-400 system. Some stuff carry over from S-300 variants but the most high profile element is the supposed 400km range SAM. It's marketing nonsense. There is no way the missile is useful at 400km from the launch site. The radars can barely provide fire control at half that range against any decently modern, low RCS target. Anti-stealth?? LOL well testing that claim is one out of many reasons why China bought some and seeing as it's been years since any second order and any copying of those radars, I would assume those claims are bogus. You can test a tiny stealthified drone with appropriate shaping and materials if you think J-20 isn't going to be an accurate simulation of F-22 or F-35 RCS. It's easy to test the claims of the S-400 anti-stealth and they certainly don't work as claimed... I mean even UHF radars have a good effect on this but useless in real application. Again just like the Su-35, not a great deal was purchased. For reverse engineering? errrgh try to understand things better if one believes this. Maybe there are a few things the Russians have done differently that's definitely worth applying but you'll not see a Chinese version of the S-400 in its entirety like we have for the Su-27SK -> J-11A and then J-11B platforms. At most they apply some worthwhile notes to any newer HQ-9 standard blocks (read non BMD range enhanced HQ-9 variant). Chinese radar systems and ground based radars don't really lag Russia any more if even that. Naval radars are well ahead, I can see Russian OTH and early warning stuff being ahead but SAMs... nahhh. No need. Have UHF VHF radars for the "anti-stealth" hype. Chinese used own radars for ASAT test back in 2000s. Own SAMs operate on Chinese radars including BMD ones and the recent anti-HGV test interception.
All in all, the S-400 for China represents a great opportunity to learn and adopt anything there is to learn (one is left to wonder and assume), test and evaluate a widely export available (Turkey, India) SAM that is the height of Russian SAM capability at the moment. S-500 is BMD focused and totally different kind of tool. It also means they are used as yet another unintegrated, independent layer of air defence for China. They have placed most of the S-400s around Beijing alongside integrated Chinese AD systems as sort of another supplement and redundancy that's engineered in slightly different ways (therefore potentially covering any technical and electronic gaps left by Chinese AD like HQ-16 and HQ-9 series).
As a BMD, the S-400 isn't capable of midcourse interception IIRC. For that China uses HQ-19, HQ-26, and HQ-29 or whatever other and overlapping missiles they have. The Russians themselves use S-500 and other Cold War era BMD projects that have continued development as the Soviet equivalent of Nike Ajax projects. For terminal phase interception, S-400 is probably pretty good as well as HQ-9 but with better reach and energy = better mechanical interception performance. But with this, even a well positioned mid range missile could potentially do okay if it's missile range is within reach of re-entry vehicle.
S-400 is suspected to be good for engaging larger targets at the more extreme end of its advertised range. The 40N6E here beats out the longest publicly disclosed standard (non BMD type) HQ-9 variant range. No SAM is really that great at swatting fighters out of the sky to be honest. Unless the attacker is an idiot. Not even 4th gens you can track at basically max range. When used in this manner, SAMs are good A2AD weapons and slow down enemy progress because they need to perform SEAD/DEAD. S-400s also probably pretty crap against cruise missiles and newer stealthy cruise missiles with sophisticated terrain following, radar avoidance, and attack angle paths... not slamming it but all SAMs are basically not great against terrain hugging stealthy cruise missiles with good EW. So SAMs being used at really long ranges are mostly only okayish for large, ideally clumsy targets like AWACS and tankers. Of course, a fighter that strays well within the NEZ of a long range SAM like S-400's 40N6E or 48N6E3, has a very low chance of surviving unless they can make use of terrain.
All that said, S-400 is a much overhyped but very capable and probably world leading SAM system for the purposes it's designed for. It does anti-aircraft, interceptions of whatever, A2AD, tracking and targeting, equal if not better than the best long range SAMs around the world - Patriot improved, PAC3, HQ-9A/B/C, S-300xyz, Aster 30. So given the chance to buy, yeah of course China would buy at least a few to study, a few to test, a few to actually use in defence. Even the US would LOVE to get its hands on some. They're sensitive enough about it to ban F-35 sale to Turkey simply because Turkey will be familiar with S-400.