Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:81:24

And Muhammad is not a withholder of ˹knowledge of˺ the unseen.  

and he, Muhammad (s), is not to be accused of ˹knowing˺ the Unseen, what is hidden of the revelation and the tidings of the heaven (a variant reading ˹for bi-zanīnin˺ has bi-danīnin, meaning that he is not ‘niggardly’ ˹with the Unseen˺ so as to reduce something of it ˹and not disclose it˺).
القرآن:٨١:٢٤

وَمَا هُوَ عَلَى الْغَيْبِ بِضَنِينٍ  

{وما هو} محمد ﷺ {على الغيب} ما غاب من الوحي وخبر السماء {بظنين} أي بمتهم، وفي قراءة بالضاد، أي ببخيل فينتقص شيئا منه.