1st the question "Can someone teach something they do not know?" is not the same as "Can someone teach something they cannot do?"
Many athletic coaches aren't even close in ability to some of thier students, but they have more knowledge and other skills (like the ability to teach which is unrelated to the ability to perform.) A parapalegic with perfect pitch would make a better piano instructor than Bethoven would have in his old age (when he could play perfectly but was deaf.)
This is apart from the fact that, as other in this thread have mentioned, for many of the beings these pacts are made with asking why they can't cast the spell they provide is like asking how the wind can drive a ship when it can't read a sextant. In fact in the Warlock class description it mentions that some of the beings providing a GOO pact may not have the slightest idea the warlock exists, which is probably all for the best.
As far as the GOO go, Lovecraft translates poorly into D&D even if he has had a presence ever since the first Deities & Demigods. In Lovecrafts stories many of the otherworldly horrors are pretty tame by D&D standards, Mi-go and Elder Things for example are nothing more than flesh and blood (or ichor) beings of moderate personal power and tremendous technological advantages. Really most horror movie monsters fair poorly in D&D translations. However the great old ones like Cthulu and Azathoth are different entirely, they literally do play by different rules. You can't kill Cthulu because he isn't alive, not in any sense we would understand.
Now, that having been said, in the Lovecraftian mythos the elder gods are not in competition with Thor and Corellon. In the jumbled theological garbage bin that is the Forgotten Realms, how exactly a pissing contest between Nyarlothotep and Odin plays out is pretty much up to the GM.