Does your bot do anything or just idle? By that, I don't mean just watching your channel, but doing something that sends information to the network (doing a /whois on someone when they join, sending messages to you or others, etc). If not, you might want to use a timer that will do a ping every minute or two and see if that solves your problem.
You might also want to try being on another network and see what happens. It may be something related to that network. Since you say it happens often, it shouldn't take long to know if it's happening there. You don't have to be in a "real" channel... just some test channel with no one else there.
Beyond that, it could be some setting in your network options and/or router/firewall causing it.