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?
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.