“If they come to you, judge between them or turn away from them” (al-Māʾidah 5:42) is compared with the instruction to judge according to what Allah has revealed (5:49).
One reading treats the later imperative as removing the earlier discretion. Another distinguishes whether a particular case must be accepted for adjudication from the normative standard governing a case once accepted.
That distinction yields two separate questions: whether to hear a dispute, and how to rule if it is heard. A passage requiring just adjudication does not, by its wording alone, settle every question of jurisdiction or mandatory acceptance.