Why belief in in the Books is mentioned before belief in the Messengers
Question

                Why does belief in the Books come after belief in the angels and before belief in the Messengers in the hadith of the Prophet: “To believe in Allah, His angels, His Books, His Messengers, the Last Day, and to believe in predestination (al-qadar), both good and bad”?
Praise be to Allah.The first article of faith that is required of a person is to believe in Allah, may He be glorified and exalted, because if it is not established that this universe has a God, then it is not possible to establish the truthfulness of the Prophets (blessings and peace of Allah be upon them). So knowing Allah, may He be exalted, is the foundation, which is why Allah is mentioned first in this list of beliefs.
Then, in many religious texts, belief in the noble angels of Allah is mentioned after belief in Allah, may He be exalted. The wisdom behind that is that Allah, may He be glorified and exalted, only sent revelation to the Prophets (blessings and peace of Allah be upon them) through the angels, as He says (interpretation of the meaning):
“He sends down the angels, with the inspiration of His command, upon whom He wills of His servants”
[an-Nahl 16:2]
“The Trustworthy Spirit [Jibreel] has brought it down
Upon your heart, [O Muhammad] - that you may be of the warners -”
[ash-Shu‘araa’ 26:193-194].
As it is established that the revelation of Allah, may He be exalted, only reached humanity through the angels, then the angels are the intermediaries between Allah, may He be exalted, and humanity. It is for this reason that the angels are mentioned second in this list.
For this reason also, “Allah witnesses that there is no deity except Him, and [so do] the angels and those of knowledge - [that He is] maintaining [creation] in justice. There is no deity except Him, the Exalted in Might, the Wise” [Aal ‘Imraan 3:18].
The third in this list is the Books, which refers to the revelation that the angel brought from Allah, may He be exalted, and delivered to humanity. So the angel is mentioned before the books, and the books are mentioned after that for this reason.
The fourth in this list is the Messengers, who are the ones who received the light of revelation from the angels. For this reason, the messengers are listed in fourth place.
This was discussed by ar-Raazi in at-Tafseer (7/108); see also: Haashiyat Zaadah ‘ala al-Baydaawi (2/694).
At-Teebi said: The angel is mentioned before the Book and the Messengers, following the sequence of events in reality, because Allah, may He be glorified and exalted, sent the angel with the book to the Messenger.
End quote from Sharh al-Mishkaat (2/425).
Whatever the case, this comes under the heading of subtle points of knowledge, and is not one of the pillars or foundations on which any beliefs or rulings are built.
And Allah knows best