As-Salaam alaikum,
In ayat 28 of the 34th chapter of the Holy Qur'an, we have it where Allah Ta'ala says:--

"We have not sent you (O Muhammad) but as a universal (Messenger)
to all men, giving them glad tidings, and warning them (against sin)." (34:28)

Note that the ayat says "kaaffatan li-Nass.." not 'Lin-naasi kaaffah'..putting kaaffah before 'an-naas... which means this Message being delivered by the Prophet, Sallallahu alaihi Wasallam, is meant for all human beings, no one is excluded until this world comes is finished. Indeed, in this ayat (verse), it is as if Allah Ta'ala is saying that the Prophet, alaihi-salaat was-salaam, from the beginning has been sent not with the message only when he was 40 years of age, but also before Adam was created.