II Kings 4:29,31 presents a story-within-a-story, Elisha's delegation of Gehazi to revive the Shunamit's son.
The question of why the delegation fails is a classic question. The question of why this little story of failure, in two verses, is included in the text is also a classic, separate question, but is less frequently asked. The text itself provides no direct answers. The answers can only be inferred from what is not written.
The staff obviously represents Elisha's spiritual authority and mission, as the shepherd of Israel. As in the story of Moses's staff, it is the agency of miracle.
The critical view of this passage as presented by Professor Yair Zakovitch, is that it is included in its current form as an unstated but nonetheless forceful criticism of Elijah, Elisha and the popular miracle-working religion that they represent. According to this understanding of the text as a polemic, the Deuteronomic writer presents the events of Elijah's and Elisha's ministries unfavorably in order to downgrade or de-rate their standing relative to Moses. Apparently at some time in history the standing of these prophets threatened to eclipse that of Moses in the popular mind. This eclipsing of Moses by later figures, especially miracle workers, is a perennial challenge in Judaism. Examples are Honi the Circle Drawer and Rabbi Simeon Bar Yohai, the purported author of the Zohar. Not to mention more recent figures, Sabbatai Zevi and later.
In this view, the delegation of Gehazi for the mission of reviving the boy illustrates Elisha's blindness to Gehazi's corruption and unworthiness to be Elisha's successor. Even after the mission fails, Elisha shows no understanding of who Gehazi really is. Besided being a criticism of Elisha, it is also a criticism of miracle-working popular religion that always attracts unseemly figures who cluster around the miracle worker for their own gain. The intent of the writer is to contrast Gehazi to Joshua, the corresponding figure in Moses's ministry.
The failure of Gehazi's mission is also a criticism of Elisha for not taking personal responsibility for the situation that he himself created by working an entirely unasked-for miracle, responsibility that he is ultimately forced to take.
The entire story presents a comic and derogatory picture of Elisha as a spiritual Don Quixote. He works an unasked-for miracle for the Shunamite woman, removes himself far away to the Carmel with his corrupt side-kick second-in-command, fumbles the first revival attempt through Gehazi, and only succeeds in the end through a suggestive physical closeness with a corpse.