A recurring story need not serve precisely the same rhetorical purpose in every surah.

Wisdom of Recurrence and Arrangement, and Dimensions of Qur’anic Inimitability