Even if you know the correct spelling, it's an easy mistake to make when you're writing fast. Sometimes hands seem to just want to do their own thing while typing out what you thought your brain was telling them :P I make so many mistakes this way that I try to be forgiving when I see it probably happened to someone else.
Regarding cannon vs canon, the way I remember it is that "you need a double-n for a cannon to be double-barrelled." I have no idea whether that's useful to anyone else.
Etymologically, they are both related to "cane", so it's pretty much a historical accident that we now spell them differently to each other, or that it's not the other way around.
[1]: https://en.m.wiktionary.org/wiki/headcanon