The contract MAY preclude a customer from participating in Economic Sanctions against the seller.
It would not be an unusual clause, and would allow a case to proceed in court.
Whether Russia would win the case is another matter.
Russia owns the commodity and the means to defend it. Courts are useless. Are they going to rule that Russia has to keep the pipes on? How will thry enforce?