Praise be to Allah.
We put this question to Shaykh ‘Abd ar-Rahmaan al-Barraak (may Allah preserve him) and he said:
What appears to be the case – and Allah knows best – is that if a person comes to the mosque where he usually prays and finds that the people have left, and he thinks that people in other mosques are about to finish and leave, and he does not think that there is any mosque nearby in which Jumu‘ah prayers are still going on, if he is in that situation, and he prays Zuhr, then he hears another mosque praying Jumu‘ah, he does not have to pray with them, because he has not been negligent.
But if he does pray with them, that is better for him and is more on the safe side, and there is the hope that he will attain the virtue of Jumu‘ah thereby.
But if he knew that the mosque where he usually prays does the prayer before other mosques, and they pray early, and he missed the prayer in that mosque, but he knows that there are other mosques where he could catch up with the prayer, then in that case he must pray Jumu‘ah with them.
And Allah knows best.