The fact is if US puts sanctions on us, we either move closer to China (not possible) or to Russia (which will indirectly be China). This is something which US would be knowing and can threaten us and ask us to decouple from Russia (military hardware) and China (economicaly), both of which will not be in our favour.
India is not a fool.. If the compromises to its national interest that India has to make by becoming China's junior partner, is less than, the harm to Indian interests by becoming US junior partner, then India will not hesitate to make a deal with China.. There is no permanent enemy as they say..
We are in a sweet spot here.. China will never compromise on Taiwan, which it will try and annex some day in the future.. Once, that happens, China controls the first Island chain, and the defence of Japan, against a China, which by the time, will have a bigger economy than US, will become untenable..
US will have a hard time containing China and save its alliance with Japan.. so it can punish India only so much..
If we get sanctioned by US, I envision that India will reduce arms imports from both Russia and US.. and import from France, even that will reduce over time.. as we go full tilt aatmanirbhar.. India might compensate Russia, for the reduction in arms imports by importing energy for example..