Generic answer: You go to the second gun whenever it's faster to solve the problem than fixing your first gun.
More specific, but still general: Beating the opponent about the eye socket and temple with the primary may be faster than going to the BUG. Running like your hair is on fire might be faster than either. IOW, our real job is to win the fight, not to shoot him.
How do you know? Train.
"To spit on your hands and lower the pike; to stand fast over the body of Leonidas the King; to be rear guard at Kunu-Ri; to stand and be still to the Birkenhead Drill; these are not rational acts. They are often merely necessary." Pournelle