Swami Gambhirananda translates Sri Sankaracharya's Sanskrit commentary on BG 9.23 as:
9.23 Even those who, being devoted to other deities and endowed with faith, worship (them), they also, O son of Kunti, worship Me alone (though) following the wrong method.
There is a word "avidhi purvakam" in the verse, which means "following wrong method". Here by wrong method it means, a worship in which deities are worshiped in their limited aspect and not as Supreme Brahman.
Yet, even such worship reach Supreme Brahman as Brahman is Atman/Self of even the deities. The term "Me" refers to Para-Brahman and not to limited aspect of Krishna. So, verse 9.23 is saying that, if a person worships the deity in their limiting aspect, it is a wrong method of worship and hence, the results attained will also be limited and lower than the result attained by worshiping Para-Brahman.
This becomes more clear in 9.24, wherein Krishna says:
9.24 I indeed am the enjoyer as also the Lord of all sacrifices; but they do not know Me in reality. Therefore they fall.
Here, Krishna himself says that, by "Me" he is referring to the One who is the enjoyer of all Sacrifices. Who is the enjoyer of all sacrifices? It is none other than Brahman who exist as Self/Atman of all creatures. Because, Brahman is the Self of all creatures, he alone is the enjoyer of all sacrifices as well.
Hence, if a person had performed worshiped knowing the real nature of Brahman as the Self of all, then it would have helped a person to purify his mind and slowly attain ultimate Moksha. But, because, a person does not understand Brahman's true nature, the result obtained from such a worship is lesser or lower. Here, the term lower is only with respect to the ultimate goal of Moksha.
So, what results do people get who worship deities in limited aspect? Krishna answers this in verse 9.25:
9.25 Votaries of the gods reach the gods; the votarites of the manes go to the manes; the worshippers of the Beings reach the Beings; and those who worship Me reach Me.
That is, because a person worships a limited aspect, be it a deity or a pitr or any other beings, the result of such worship is that it takes the devotee to the realm of those deities or pitrs etc. But, after spending the time in those realms (till the time the fruits of worship exhausts), the person returns back to Manushya loka/Physical realm.
On the other hand, those who worship Para-Brahman, he will slowly attain chitta-shuddhi and with practice of Vichara (Self-Enquiry), they will attain Atma-Jnana as well and become Jivanmuktas.
So, there is no contradiction. You may like to read this: A deity can either be God or god or both