Why it's happening always with Russia weapons? If some illiterate Mujahideen can use western weapons successfully without training in 90s,and now Ukranians too, there is clearly an advantages with weapon design.
It has more to do with circumstances.
The SU left Afghanistan because their country was collapsing. The Ukrainians are doing well because the Russians are not really fighting, they are just standing around getting shot at, while the enemy is using weapons that the West created to counter old Cold War tech that the Russians are using today.
It's no different from how our Mig-21 shot down PAF's F-16. The Mig-21's weapon was a generation ahead compared to the F-16's basic design. Only later designs really had the ability to counter it. So in Ukraine, they are using 3rd gen Javelins and NLAWs which are a generation ahead compared to Russia's Cold War era armour which has only been designed to defeat 2nd gen ATGMs. The counter to that is artillery and helicopters, but RA is not using either one properly in Ukraine.
In the Iraq War, the Iraqis were two generations behind the Americans. Iraqi generals were bribed, so they gave up and retreated into Syria.
Otoh, look how quickly the Taliban took control of Afghanistan even though the ANA were a generation ahead with Western weapons.
India has done very well against Pakistan with Russian weapons. Particularly 1971.
Plus the Soviet Union kept their clients a generation behind themselves. And after its dissolution, even the Russians have fallen behind by a generation. But their modernisation plan will give them a generation advantage over the coming decade against NATO.
In India's context, we accept what works, like the S-400 and AK-203, and reject what we think is not good enough, like the Pantsir and Amur. So we preferred Biho over Pantsir, or Rafale over Mig-35, but we will likely prefer S-550 over AEGIS. And if it's good enough, we will pick Indian over import. We are choosing whatever works best for us at that moment, be it Russian, Western or Indian.
SoKo prefers to work with Russia when it comes to missiles because the Russians are really good at it. So SoKo's new SAMs and BMs are based on Russian designs. They also have a JV with Russia for Brahmos. So importers have to mix and match when they have the opportunity. Not one country makes the best of everything.