Does there exist a Pali Canon sutta that claims that a Bodhisattva can only be a male Brahmin or Kshatriya? If yes, is it possibly apocryphal? I ask this question as someone on Twitter was arguing that Buddhism is casteist. He claimed that only upper castes were permitted to enter monkhood. I told him this was completely false and shared the example of Upali the barber. He shared the following link: Buddhism: An Atheistic and Anti-Caste Religion? by Edmund Weber.

The standpoint which caste a Buddha should belong to has not been revised in Buddhism up to the present day. It is dogmatised in the Lalitavistara in the following way: a Bodhisattva can by no means
come from a lower or even mixed caste:

“After all Bodhisattvas were not born in despised lineage,
among pariahs, in families of pipe or cart makers, or mixed castes.”

Instead, in perfect harmony with the Great Sermon, it was said that:

“The Bodhisattvas appear only in
two kinds of lineage, the one of the brahmanas and of the warriors (kshatriya).”


I corrected him that the document referred to Bodhisattvas and not ordinary monks who could grow to become full Arahants. He claimed that the religion was still casteist as only Brahmin and Kshatriyas could become Bodhisattvas. What does the Pali cannon say regarding this? Can you share any studies done on this by scholars?
List of the named Buddhas

In countries where Theravāda Buddhism is practiced by the majority of people, such as Sri Lanka, Cambodia, Laos, Myanmar, Thailand, it is customary for Buddhists to hold elaborate festivals, especially during the fair weather season, paying homage to the 29 Buddhas described in the Buddhavamsa. The Buddhavamsa is a text which describes the life of Gautama Buddha and the 27 Buddhas who preceded him, along with the future Metteyya Buddha.[2] The Buddhavamsa is part of the Khuddaka Nikāya, which in turn is part of the Sutta Piṭaka. The Sutta Piṭaka is one of three main sections of the Pāli Canon of Theravāda Buddhism.

I note that in this table the class (varṇa) of all 29 is listed as either Kshatriya or Brahmin (except 3 which aren't listed).
So the answer seems to be &quot;yes&quot; if you include the Buddhavamsa -- which I imagine is the only text which says that.

Along with the Apadāna and the Cariyāpiṭaka, the Buddhavaṃsa is considered by most scholars to have been written during the 1st and 2nd century BCE, and is therefore a late addition to the Pāli Canon.