You are asking about this verse:
لتؤمنوا بالله ورسوله وتعزروه وتوقروه وتسبحوه بكرة وأصيلا
That you [people] may believe in Allah and His Messenger and honor him and respect the Prophet and exalt Allah morning and afternoon.
— Quran 48:9
A more literal translation would be:
لتؤمنوا بالله ورسوله وتعزروه وتوقروه وتسبحوه بكرة وأصيلا
That you may believe in Allah and His Messenger and honor him and respect him and exalt Him morning and afternoon.
There are different views about the subject of the first two pronouns. تعزروه (honour him) and وتوقروه (respect him) may either refer to Allah or to the Prophet.
As for the last one , تسبحوه (glorify him) , it refers to Allah. There is no narration from Ibn Abbas or anyone else among the major exegetes who thinks that this applies to the prophet ﷺ. You may check e.g. Durr al-Manthoor, Tafsir al-Tabary etc. Qurtubi even claims that there is no difference of opinion on this part:
يكون بعض الكلام راجعا إلى الله سبحانه وتعالى ، وهو وتسبحوه من غير خلاف
The pronoun in some of the text returns to Allah and this is وتسبحوه (glorify him) and in this there is no disagreement
— Tafsir al-Qurtubi
As for the claim:
according to the rules of arabic grammar it dictate that what follows after a name will refer to the last person mentioned.
That is at best an oversimplification and ignores the distinction between what is common and what is valid.
Various verses may be cited as counter examples to this rule like:
فآمن له لوط وقال إني مهاجر إلى ربي إنه هو العزيز الحكيم ووهبنا له إسحاق ويعقوب وجعلنا في ذريته النبوة والكتاب وآتيناه أجره في الدنيا وإنه في الآخرة لمن الصالحين
And Lot believed him. He said, "Indeed, I will emigrate to [the service of] my Lord. Indeed, He is the Exalted in Might, the Wise." And We gave to him Isaac and Jacob and placed in his descendants prophethood and scripture. And We gave him his reward in this world, and indeed, he is in the Hereafter among the righteous.
— Quran 29:26-27
The last person named here is prophet Lut. However it is obvious that the pronoun refers to the one named before, i.e. Abraham since Isaac and Jacob were the children of Abraham, who was named in 29:16.
Or consider the verse:
وما هو بقول شيطان رجيم
And it is not the word of a devil, expelled [from the heavens].
— Quran 81:25
The last person named in this sequence is Prophet Muhammad ﷺ in verse 81:22; whereas the pronoun in the above verse returns to the Quran from verse 81:19.
Or consider the verses where a pronoun is used twice to refer to two distinct groups:
لا تستفت فيهم منهم أحدا
And do not ask anyone of these about them.
— Quran 18:22
انوا أشد منهم قوة وأثاروا الأرض وعمروها أكثر مما عمروها
They were stronger than these in power, and they had tilled the land and had made it more populous than these have made it
— Quran 30:9
It is obvious from the context that both instances of the pronoun can not refer to a single noun, so obviously one must refer to a noun that has been mentioned earlier than the other.