I once ran across a term for the error of misunderstanding the meaning or sense of a word because one doesn't know exactly what the word is. For example, someone mistakenly thinks that the phrase is "tow the line" rather than "toe the line." Can anyone tell me what this type of misunderstanding is called?
As Edwin Ashworth has already mentioned, your example are homophones, not homonyms. A homonym looks the same and sounds the same. Stalk (follow) and stalk (stem of a plant) are homonyms. Read (a book) and reed (plant) are homophones.
In the strictest sense, there is sometimes a distinction drawn between 'true' homonyms as above, and polysemes where the words have a shared etymology and are technically the same word with differing meanings, such as mole (furry thing in a hole) and mole (a spy).
Alternatives to mondegreens -
malapropism - (the unintentional misuse of a word by confusion with one that sounds similar
or eggcorn if the phrase retains an unintentional meaning, signaled out instead of singled out for example.
These errors are called mondegreens, especially in the context of misheard lyrics.