Should a question with irrelevant context be closed as a duplicate if it has been asked before in another irrelevant context?
The answer to that is another question: are all answers to the former equally fully valid to the later if we remove the irrelevant context? If yes, then I suggest you to remove the irrelevant context from both questions and close as duplicated. Two questions are duplicates when they are basically asking the same thing. Sometimes you need more context to know, other times, you need less.
If you can't do this without changing the questions in a meaningful way (invalid answers becomes valid or vise-versa), just create answers for both of them, tailored to the specific needs.