The Messenger of Allah ﷺ forbade the sale involving uncertainty. He said that the people of the pre-Islamic era used to engage in such transactions, where a man would purchase an aged she-camel in exchange for the offspring of an unborn camel. So the Messenger of Allah ﷺ prohibited it.Muhammad bin Ubayd, in his version of the hadith, said, "the offspring of an unborn camel, and the Messenger of Allah ﷺ forbade that."
حدثنا يعلى ومحمد قالا حدثنا محمد يعني ابن إسحاق حدثني نافع
نهى رسول الله ﷺ عن بيع الغرر وقال إن أهل الجاهلية كانوا يتبايعون ذلك البيع يبتاع الرجل بالشارف حبل الحبلة فنهى رسول الله ﷺ قال محمد بن عبيد في حديثه حبل الحبلة فنهى رسول الله ﷺ عن ذلك
Its isnad is sahih. The prohibition against selling habl al-habalah has already been mentioned several times, in both lengthy and abbreviated forms, including at 4491, 4640, 5307, 5466, 5510, and 5862. The sale of habl al-habalah falls under gharar, but the general prohibition against selling on the basis of gharar was not narrated by any of the authors of the six books from the hadith of Ibn Umar. It was narrated by the group of scholars other than Bukhari from the hadith of Abu Hurairah, as found in al-Muntaqa, 2788. Its meaning has already appeared in the Musnad from the hadith of Ibn Abbas, 2752, and from the hadith of Ibn Masud, 3676.Haythami considered it among the additions, meaning the hadith of Ibn Umar concerning the prohibition against selling on the basis of gharar, and mentioned it there at 80:4, saying, "Tabarani narrated it in al-Awsat, and its men are trustworthy." He failed to attribute it to the Musnad, though it is there, as you can see.Gharar, spelled with a dotted ghayn carrying a fatha and a ra with a fatha, was already explained in the hadith of Ibn Abbas. Al-sharif means an old, aged she-camel.