There is much to disentangle here
1. Both quotes mention alternative wordings (Imams ARE Prophets instead of Imams AND Prophets)
2. The Maliki Muhaddith, Muhammad b. Ja'far al-Kattani explained these statements in his book
3. Many Maliki scholars attested to Alahazrat's Dawlah
Mālikiyyah takfīrring Ahmad raza khan yet again
ʾImām ash-Shinqīṭī (رحمه الله) writes,
And by consensus, zakāh is not given to one who is declared a disbeliever due to his innovation, by agreement—such as the one who claims the prophethood of ʿAlī, and that Jibrīl made a mistake; and the one who says that there are two messengers in the Ummah: a speaking one, and that is al-Muṣṭafā ﷺ, and a silent one, and that is ʿAlī (may Allah be pleased with him); and the one who claims that the Imams and the Prophets know what has been and what will be, and similar beliefs. This was stated by ʿAbd al-Bāqī [az-Zarqānī].
╾ Lawāmiʿ al-Durar (3/505)╼
ʾImām az-Zarqānī (رحمه الله) writes,
And (zakāh) is not given from it, by consensus, to one who is declared a disbeliever due to his innovation, by agreement—such as the one who claims the prophethood of ʿAlī, and that Jibrīl made a mistake; and the one who says that there are two messengers in the Ummah: a speaking one, and that is al-Muṣṭafā (the Prophet ﷺ), and a silent one, and that is ʿAlī; and the one who claims that the Imams and the Prophets know what has been and what will be, and the like of these beliefs.
╾ Sharḥ az-Zarqānī ʿalā Mukhtaṣar Sayyidī Khalīl (2/309)╼
Oh barelwīs your founding figure himself states, the Prophet ﷺ knows what has been and what will be, however the Mālikiyyah may Allah bless them have states its kufr by agreement.
Barelwī sect founder Aḥmad Riḍā Khān writes,
Allah granted His beloved ﷺ detailed knowledge of every single particle of all that was among the first and the last, the east and the west, the Throne and what lies beneath the earth, and everything that has been and will be until the end of days. The explanation of this is found in our treatises Anbāʾ al-Muṣṭafā, Khāliṣ al-Iʿtiqād, al-Dawlah al-Makkiyyah, and others.
*╾ Fatāwā Riḍawiyyah (29/284) ╼