Hmmm. That is an interesting theory. Bailey probably was selected for his important job because he did not react to noises. JJ could have been bothered by the sound or have hardly seemed to hear it. I do not know, but someone who knew JJ might. Even if neither Bailey nor JJ support your theory, it does not mean your theory is not possible.
I do not think Bailey would "pass" his training if he were reactive to gun shots or other sudden loud noises. He was likely unfazed by the gunshot.
As for JJ and the gun shot, that is very JJ specific. My experience with autistic children is that they often have sensory differences, but the differences vary. Some over-react to various sensory input and some under-react. Some crave various kinds of sensory input and usually this is (in combination of not seeing the point of view of others, who might be making fun) what motivates behaviors that look strange. There might be a certain kind of sensation that each individual autistic person might over respond to, under-respond to, or crave.
It depends on JJ if the gun shot sound- apart from its meaning- would have been aversive, neutral or pleasant. If aversive, Bailey would have probably made it feel less aversive, if he was there. Some autistic kids can ignore a fire alarm, and would rather finish whatever they are doing than evacuate a building. Others run for the hills because of the sound of a fan in the distance that "hurts their ears" even when no one else noticed it.
It also depends on JJ's experience about what the gun shot means- separate from its sound. I don't think autism is a factor here. I do not think it is likely he did not know what a gun was, but I do think it was likely he had a young-white child-appropriate favorable view of guns. A gun shot may not have been as traumatic to him as it would be to me. I am old, and most of my life experience is in suburbs close to larger cities. When I hear a gun, I think homicide or police violence. But JJ probably associated guns with good guys and video games. JJ lived in areas where adults might have thought of guns as symbols of freedom, hunting or self-protection.
Unless JJ happened to be bothered by loud noises, the trauma of the morning was more likely the sudden change in plans. Suddenly changing his ride MAY have bothered him. However, Bailey (if he was there) and still stopping for his ritual breakfast would have helped ease the anxiety caused by the sudden change.
His school in AZ was private, right? I haven't seen references to Bailey attending. By the time he got to ID, Bailey was given back.

I don't know anything about the school and if they were asked and declined to allow Bailey to attend, If Bailey was there, or if Bailey waited for JJ at home and the school was not asked.