It is related that during the Abbasid campaign of energic search for Wafi Ahmad, the hujjat, dais and the followers demonstrated matchless example of their firm faith. But one of the dais, called Ahmad bin al-Kayyal al-Khasibi had deviated from Ismailism. He had acquired Ismaili teachings from Imam and was well steeped in esoteric doctrines (kalimat ismiyya), but concocted his own theories that were contrary to the Ismaili faith. When Wafi Ahmad was informed about his negative propaganda, his having created confusion in the community, he excommunicated him, ordering his followers to separate from him. When Ibn al-Kayyal learnt the severe actions of Wafi Ahmad against him, he publicly renounced his allegiance and proclaimed himself first an Imam, and later on the promised Mahdi on earth to establish peace. Shahrastani also writes in "Kitab al-milal wa'l-nihal" (p. 17) that, "Ibn al-Kayyal had claimed the Imamate for himself and asserted that he was the promised Qaim on earth." He founded a sect called after him Kayyaliyya, who incorporated different heretical ideas in their doctrines. Ahmad bin al-Kayyal was however executed by his own followers in 207/822 who depended upon him, when they understood his impiety and his idea to spread trouble in the world. With the end of Ahmad bin al-Kayyal, the Kayyaliyya sect also disappeared and its handful followers reverted to their original faith of Ismailism.
Wafi Ahmad further on repaired to Daylam with his 32 trusted dais, where he got married with an Alid lady in the village of Ashnash, and had a son by her, whom he named Ahmad, who later on became known as Taqi Muhammad. The adoption of strict taqiya, and moving from one to another place, forced Wafi Ahmad to assign the mission works to his brother, Hussain bin Muhammad. He ordered his followers to obey his brother, saying: "One who obeys him, he obeys myself, and one who disobeys him, he disobeys me." Hussain bin Muhammad with a party, disguised as merchants, went on pilgrimage to Mecca. He then arrived in Ahwaz from Samarra. A certain dai started preaching in favour of Hussain bin Muhammad, stating that Wafi Ahmad appointed him instead of himself. When Hussain heard about this, he went to the place where the dai resided, collected the concerned people, and declared that he was not the Imam, but a lieutenant of his brother, his servant and his slave. When the people heard this, their allegiance to the Imam increased.