A homonym is not the same word. Homonyms include both homographs, which are still two different words with different meanings, just spelled the same way (e.g lead[verb] and lead[noun]), and homophones, which are also still two different words with different meanings, just pronounced the same way (e.g. there and their). That said, homonyms also includes word pairs that are both homographs and homophones like "bat", being the animal, the verb, and the baseball equipment (presumably among other uses).
Seems to be one of the cases that the academic definition has been simplified in public (quite like theory/hypothesis from science) use and, consequently, adopted by dictionaries making it canonical for many. So your definition is correct from theoretical linguistics perspective but dictionaries also give the broader umbrella definition GP mentions. Ironically dictionaries may've been the reason this distinction was blurred with early lexicographers grouping homographs (logically, spelling in text not relevant) and homophones under an homonym heading.
It's also interesting checking their (Greek originating) etymologies and morphologies. Homo- from omós meaning same, -graph/-phone/-onym from gráphō/phōné/ónoma (ō becoming represented by letter ω in modern Greek) meaning writing/sound/name. And, syn-, equivalent to prefix co-, is from syn (preposition) meaning jointly/together. So respectively, literal meanings, being same writing, same sound, same name, co-named.
Hence about hom/synonym, their difference comes from "name" and "word" being distinct concepts. More specifically, in (Aristotelian) philosophy "name" was tied to essence of things, synonym being "same name, same essence"
*, homonym being "same name, different essence". In time "name" and "word" were conflated. Moreover synonym evolved semantically, only retaining the "same essence" as "same meaning", and homonym retained its form. Result being one term being about "many words to same meaning" and the other about "one word to many meanings"**.
*So by ancient philosophy my choice of synonym will've been accurate! But you're right they stand opposite, both then and now.
**And then there's the homonym/polysemy distinction for specifying unrelated/related meanings, essentially reviving Aristotelean essence, and the reason why in dictionaries some words (e.g. bank, see[0]) have multiple entries each with multiple meanings.