when (one) least expects it
At the point in time at which one is least prepared or has not been anticipating (something). Things seemed to be going well, and then, when I least expected it, my boss said that I was being fired. We will organize our forces and strike the enemy when they least expect it.