As you have probably noted, based on the number of posts in this topic, there is no one reason or solution.
Like you, I've used IRC (various clients) for years on multiple machines and using multiple os's, yet never came across this error until about 2 years ago, and it was so infrequent, I didn't pay much attention to it (something like once every 6/7 months).

Now, however, as I posted earlier, I'm getting it about every 12 hours. It's annoying, but my reconnect options work fine, and since I know about what time it happens, I have arranged a script to ensure that I'm logged in and using the same nick that I was using at the time of disconnection.