Q- لولاك لما خلقت الافلاك .Is there a Hadith stating that the reason Allah created this universe and everything it contains was for Muhammad (sallallahu ‘alayhi wa sallam) to come and fulfil Allah’s commandments? I’m basically asking, if it weren’t for Muhammad (sallallahu ‘alayhi wa sallam) Allah wouldn’t have created us?
The Hadith in question is reported as follows: لولاك لما خلقت الافلاك .Translation: If it were not for you O Muhammad, I would have not created the universe.
This Hadith is unanimously deemed as a fabrication, and is not suitable to quote. (Al Masnu’ Hadith: 255, Kashful Khafa Hadith: 2121, Al Fawaidul Majmu’ah pg. 326).
Al-Saghani (d. 650) said it is Maudu`.Ibn al-Jauzî also related it in a long Marfu’ hadith from (ibn ‘asaakir) and said, ‘It is Maudu`.Al-Suyûtî endorsed this in al-La’ali al-masnu’ah.
However, as Mulla `Ali al-Qari said, although not a hadith, it’s meaning is ok. So one can say the above phrase, but not put it as an authentic hadith (ie do not say “The Prophet ﷺ has said “were it not for…”). The noble Prophet ﷺ is the ultimate example for everyone to follow, and hence, everything exists to follow him and to be like him, and if it wasn’t to follow his example then things would not have been created. Hence, it may be said that he is the reason why the world was created. As a hadith it is NOT authentic, but as a statement it may be considered true.
A different version of this narration
Many scholars are of the opinion that even though the above Hadith is a fabrication, the concept and meaning is correct and is substantiated by other Hadiths and verses of the Holy Quran.(Al Asrarul Marfu’ah Hadith: 385, Kashful Khafa Hadith : 2121)
Among them are:
1. Allah Ta’ala mentions: ‘He is the one who has created the entire universe because of man’(Surah Al Baqarah verse: 29)
A recent Arab scholar, Shaykh Abdullah Siddiq Al- Ghumari (rahimahullah) writes: “The above verse shows that if it were not for man Allah Ta’ala would have not created the universe. Nabi (sallallahu ‘alayhi wa sallam) is the leader of mankind. It was customary for Arabs to address the leader of a tribe by mentioning his nation as an honor for him. Similarly here we are mentioned in the verse, but our leader i.e. Muhammad (sallallahu ‘alayhi wa sallam) is being addressed”.(Footnotes on Qasidatul Burdah of Shaykh Abdullah Sidiq Al-Ghumari)
2. Imam Hakim (rahimahullah) has recorded a lengthy narration on the authority of Sayyiduna Umar (radiyallahu ‘anhu) regarding the tawbah (repentance) of Adam (‘alayhis salam), in which the following words appear “….. If it were not for him (Muhammad sallallahu ‘alayhi wa sallam), I would not have even created you.(Mustadrak Hakim vol. 2 pg. 615)
Imam Bayhaqi (rahimahullah) has graded this Hadith as weak. Some recent scholars are also of the view that this Hadith is weak.Imam Hakim (rahimahullah) has also reported another narration with similar words on the authority of Abdullah bin Abbas (radiyallahu ‘anhuma), this narration supports the previous one thus making it suitable to quote.(Mustadrak Hakim vol. 2 pg. 615, Dalailun Nubuwwah vol. 5 pg. 489, Ar Raddul Muhkamul Matin pgs. 134-140, also see Shifa us Siqam pg 153)
Summary
The words which you have quoted in the question are not suitable to quote as a Hadith, however the narration of Sayyiduna ‘Umar (radiyallahu ‘anhu) in Mustadrak Hakim is suitable and should be quoted instead.
And Allah Ta’ala knows best
3 Fatwa links below
https://hadithanswers.com/if-it-wasnt-for-muhammad-sallallahualayhi-wasallam-the-world-wouldnt-be-created/
https://islamqa.info/en/answers/23290/were-it-not-for-you-i-would-not-have-created-the-universe
https://mawdu.wordpress.com/2012/12/05/hadith-were-it-not-for-you-i-woud-would-not-have-created-universe/