Assalam o alaykum,
It is the well-accepted belief of Ahmad Rida Khan Barelwi & co that Holy Prophet (Allah bless him and give him peace) has been given the knowledge of ma kana wama yakun (what was and what shall be). This belief of theirs was borrowed from Ithna Ash'ari Shi’ahs. Shi’ahs establish the knowledge of ma kana wama yakun for their 12 imams.
Barelwis also believe that the Prophets have knowledge of every leaf that falls, etc.
Shaykh 'Abd al-Qadir Jailani (may Allah have mercy on him) has listed many deviant beliefs of Shi’ahs in Ghuniyat al-Talibin as well as these two deviant beliefs of theirs.
Ahmad Rida Khan Barelwi writes,
“All the knowledge (makana wama yakun) from the very first day till the last day has been given…The Prophet (Allah bless him and give him peace) knows in detail and thoroughly every tiny matter, every leaf that falls and every grain soiled in the darkness of earth and all that what has been mentioned (above) in not complete knowledge of Holy Prophet but only a tiny part from his knowledge...”
Scan from Ahmad Rida:
Shaykh 'Abd al-Qadir Jailani, while discussing deviant 'aqiad of Shi'ahs, writes in Ghuniyat al-Talibin,
“They all (Shi’ahs) believe that their imam has such knowledge that he is aware of all things of the past and future (ma kana wama yakun) whether related to this world or the religion, he knows every thing even the number of pebbles on the surface of the earth, drops of the rain and the number of the leaves of the trees...and majority of them declare those who fought Sayyidina Ali (may Allah be pleased with him) to be kafir and they believe in many other such things.”
Scan from Ghuniyat al-Talibin:
And it says in Shi’ah book Al-Kafi,
"The Imams have knowledge of whatever occurred in the past and whatever will happen in the future (ma kana wama yakun), and nothing is concealed from them.”
Scan of Al-Kafi:
Now one can see the resemblance between the Shi'ah and Barelwi 'aqaid.