In 867, the Ghurids were Pagan, not buddhist. Claims of being Buddhist by historians were unsubstantiated, and the vast scholarly consensus was that they were Pagan before they became Islamic during the Ghaznavid invasions. I'll direct you to the wiki page and also attach some scholarly sources.
Minorsky, Vladmir (1970). Ḥudūd al-'Ālam, "The Regions of the World," page 110.
D.G. Tor, The Princeton Encyclopedia of Islamic Political Thought, page 193. ".. helped convert the recalcitrant Ghur from paganism to Islam."
Finbarr Barry Flood, Objects of Translation: Material Culture and Medieval "Hindu-Muslim" Encounter, pag e96. "..Muhhamd ibn Karram is said to have been instrumental in converting Ghur from paganism to Islam."
C.E. Bosworth, Medieval Central Asia and the Persianate World, A.C.S. Peacock, D.G. Tor, page 210. "Indeed, Ghūr remained an enclave of paganism – but of what this paganism consisted is wholly unknown to us."
K.A. Nizami, History of Civilizations of Central Asia, Volume 4, page 178. As late as the end of the tenth century, the population of Ghur was for the most part heathen. According to the geographer al-Istakhri, it was the biggest pagan enclave within the borders of Islam..[..].. The nature of the imperfect conversion is best illustrated by the fact that sometimes the names were Muslim, but the people led the life of pagans."
"Ghur, a province amid mountains and rugged country. It has a king called Ghur-shah. He draws his strength from the mir of Guzganan. In the days of old this province of Ghur was pagan.." -- Scott Cameron Levi, Ron Sela, Islamic Central Asia: An Anthology of Historical Sources, page 33.
"Pagan cults did not disappear overnight with the Arab invasions , despite the later juridical position that their practitioners were not entitled to the protection of the dhimma . In the remote and mountainous district of Ghur, for example, in what is now Afghanistan, Islam made few inroads and the older pagan religious traditions survived intact until the early eleventh century." --Jonathan Porter Berkey, The Formation of Islam: Religion and Society in the Near East, 600-1800, page 169.
"The Ghaz- navids also used madrasas endowed with augaf in order to establish Islam in the stubbornly pagan territory of Ghur , possibly through the inter- mediary of missionaries from the Karamiya." -- Robert Hillenbrand, Islamic Architecture: Form, Function, and Meaning, page 173.
"..called Ghor, was almost wholly terra incognita to the early Islamic geographers..[..].. and as the home of a race of bellicose mountaineers who remained pagan until well into the eleventh century." -- C.E. Bosworth, The New Islamic Dynasties, page 298.