btw, you know in action movies when there's 10 people with automatic weapons shooting it out in a building and talking to each other? yeah.right. firearms are so unbelievable loud, there's no way any conversation is happening in that environment. further, video doesn't do the supersonic blast justice at all it's something you have to experience.
Additionally, because noise cancellation depends on the phase of the wave relative to the receivers (your ears) it really needs to be within ~1/4 wavelength of your ears, or 3" at 1kHz.
In gun ranges, what you would probably benefit most from is passive energy reduction, so ear protectors (already usually covered) and acoustical treatment. However, acoustical surface is very expensive where flat concrete is cheap, so you end up with gun ranges being big reverberative spaces instead.
You'd need to have lots of pre-recorded shots as I imagine there's some variation between guns, calibers, etc. but I wonder how well it could actually work.
Last night, I used them at a sporting event where loud techno music was playing, and I could hardly hear the music while clearly listening to my podcast.
Proper fit of the earbuds is absolutely key and AirPods don't match everyone's ear shape, so YMMV.