Batch adding names to mac os spelling dictionary
The entries in that file must be ordered lexicographically (case-insensitive).

I assume Apple implements some sort of search algorithm, so if fzgwhduef is after xdejfu, it won't be found when spellchecking it.

Edit ~/Library/Spelling/LocalDictionary, keep the entries sorted, and killall AppleSpell in Terminal to make it read the changed file the next time you use it.