No, no there was never a rule, that "Caliph has to be of Quraish origin".
As a matter of fact there were no rules or regulations considering who has a right and who has no right to be a Caliph.
In orthodox Sunni historiography and jurisprudence it is agreed the khalifat rasul Allah must be from Quraish.
It was related that the Prophet said: “Verily Allah selected Kinanah from the descendants of Isma’il. He selected Quraish from Kinanah. He selected Bani Hashim from Quraish. He selected me from Bani Hashim” [Related by al-Awza'i from Abu 'Ammar from Wathilah]. It was also related that he said: “Whoever wants to degrade Quraish will be degraded by Allah” [Related by Abu Hilal from Qatadah from Anas; others related it from Sa'd ibn Abi Waqqas]. The subject is that the Khilafah – the leadership of Muslims – is only valid for Quraish (i.e., to be the leaders) and that no one else from mankind has a right to it.
This opinion was reported from the Sahabah from the Prophet, from both the Muhajirun [those who emigrated from Makkah to al-Madinah, most of them being from Quraish] and the Ansar [the residents of al-Madinah, most of them being from Aus and Khazraj tribes].
This is an old opinion held by important people and that they are in complete consensus ('ijma) on.
On the opinion of Ahl az-Zahir:
Ibn Hazm (died 456) said: “The Khilafah is not permissible except for a man from Quraish, and they are the descendants of Fihr ibn Malik ibn an-Nadr ibn Kinanah, those who return the lineages of their fathers back to him.”
Since the Zahir [apparent text] of the Hadith does not require Tawil [figurative interpretation], and God and the Prophet did not interpret it, then the opinion of all of those who follow the Zahir is the opinion based on the text of the Hadith itself. Such is that the Khilafah can not be for anyone except Quraish.
The is the opinion of all of the narrators of Hadith like al-Bukhari, Muslim, Ibn Abi ‘Asim and others, Radiyallahu ‘Anhum.
Hanafis
The Prophet said: “The leaders are from Quraish.”
‘Ala ad-Din al-Haskafi (died 1088) said about the Major Imamah [leadership], defining it as: “the entitlement of a general disposition of power over all mankind, which is discussed in theological rhetoric, and his (i.e., the leader’s) inauguration is the most important of obligations.
The conditions of his existence are that he be:
1) Muslim
2) Freeman
3) Male
4) Of sound mind, mature, and capable
5)
Qurashi
At-Turi (died 1138) said: “The condition is that the Khalifah be Qurashi, not that he be Hashimi.”
Ibn ‘Abidin (died 1252) commented on al-Haskafi, saying: “His saying (Qurashi) is due to his saying: “The leaders are from Quraish,” and the Ansar surrendered the Khilafah to Quraish because of this Hadith.
Malikis
Al-Mawwaq (died 897) said: “The conditions of the leadership are three:
1) Embodies the conditions of giving Fatwa [legal verdict]
2) that he be Qurashi in lineage
3) that he be a person of chivalry and competence in solving problems and important issues that might befall the nation.
This is the creed, belief of the Sunnis, taken from the Salaf [predecessors].
An-Nafarawi (died 1126) said: “It is not obligatory to obey the Imam [leader] except with the following conditions: (1) Islam, (2) being appointed, assigned to the task, (3) Masculinity, (4) Freedom, (5) Justice, (6) Knowledge, (7) Sufficiency,
(8) being from Quraish, (9) Being singular (i.e., there can’t be two.)"
Ad-Dardir (died 1201) said, describing the Khalifah: “
that he is Qurashi,
so the Khilafah of other than Quraish is not valid, because the Prophet made the Khilafah in Quraish.
As-Sawi (died 1241) said about the saying of ad-Dardir: “made
the Khilafah in Quraish”: “i.e., due to his commanding that in the bulk of many authentic Hadiths which have been repeated over and over with different chains of transmission."
Shafi’is
Al-Mawardi (died 450) said, regarding the conditions of the Khilafah: “The seventh condition:
lineage, which is that he is from Quraish, due to the texts in that
regard as well as the establishment of complete agreement on that, and no consideration should be given to Dirar when he deviated and claimed it is valid for all people.”
An-Nawawi (died 676) said, regarding the conditions of leadership: “They are: that he is appointed, a Muslim, just, free, male, knowledgable, a Mujtahid [able to derive rulings directly from the religious texts], brave, of his own opinion and sufficiency, able to hear, able to see, able to speak,
and Qurashi.”
Zakariya al-Ansari (died 926) said: “The condition(s) of the leader is his being fit for making decisions,
being Qurashi, and being brave.”
Abu Shuja’ (died 977) said: “So the condition(s) of a leader are his being fit for making decisions and being
Qurashi due to the report: “
The leaders are from Quraish.”
Hanbalis
Ahmad bin Hanbal (died 241) said: “
There is not to be, in other than Quraish, a Khalifah.”
Ibn Hamdan (died 695) said: “The greatest leadership is not valid for anyone except someone who is:
1) Muslim
2) Free
3) Male
4) Appointed
5) Just
6) Able to derive rulings directly from the religious texts
7) Brave
8) Obeyed
9) Of his own opinion
10) Able to hear, able to see, and able to speak
11)
Qurashi”
Ibn Taimiyah (died 728) said: “
There is no doubt that there is a legal ruling established specific for Quraish, which is the leadership being from them and no other,” and he said: “
As for the Khilafah being in Quraish, then this is part of His law and His religion. The texts on this are well-known, transmitted, preserved and mentioned by the Sahabah. That does not entail that the Khilafah is in a specific clan of Quraish, just as it is not valid in anyone other than Quraish, and none of the Sahabah ever reported such a thing.”
Al-Maradawi (died 885) said: “He (the leader/Imam/Khalifah) is considered to be
Qurashi, free, male, just, knowledgable, and self-sufficient, from the beginning of his appointment and continuously.”
-------
The opinion is thus assured that the Khilafah, which is the command of the Muslims and their leadership, is not valid
except for the descendants of Quraish.
This is the rreligious governance and rule of God, as well as His favoring some of His creation over others, just as such was revealed to the Prophet, who is reported to have said:
“Quraish are the Wulat [pl. of Wali, i.e., authority figures] of mankind in good times and bad until Yaum al-Qiyamah [the day of resurrection]."

