Unless you are running a profile that utilizes the instant-leave function (like Spacey's ghom profile) then this is something on your end. Could be a bad connection to your router (if you're running wireless), a problem with your ISP or most likely Blizzards shitty servers. Try running a pathping test https://us.battle.net/support/en/article/running-a-pathping-test and you can self-diagnose your problems.
I'm currently following the steps you suggested. However, this problem does not occur when the bot is not running. I've also seen several other threads today with people reporting the same problem.
Edit: Pathping completed with 0% losses across all "Hops".