Explosive fragmentation is and has been the Shell of choice for anti air. Does basically the same thing with less issues of trying to keep the Supersized buck shot from scattering across miles. It’s the reason why 20-35mm shells are the default means of anti aircraft guns post 1960. The shell is fused to either proxy detonate or range detonate. If it manages to hit a drone or missile or Mortar shell “ instakill “. If it comes close and goes boom it will likely detonate a warhead or do enough damage to disable the intruder.If you are determined to have a gun based system, I think something along the lines of a giant automatic shotgun would work much better than traditional 20-30mm shells
Main reason to try and keep it between 20-40mm is rate of fire. Bigger than 30mm it needs a special loading system, bigger than 40mm was rendered obsolete by the advances in Surface to air missiles as the need to kill Jets was filled more effectively. The modern Gun system as such falls either into fall back option where in the other systems have failed to kill it or small targets like mini drones, Missiles or Artillery shells.