It’s not even quite clear what the phrase means. It is easiest to picture live fish, for some reason, swimming in a barrel, and somebody inexplicably shooting at them. That would be an impractical, unnecessarily dangerous way of getting at the fish.
It could mean firing a gun into which you have dropped a fish or two.
It could mean shooting fish into a barrel.
It could even mean “fish” as the con-man’s word for his victims.
Good grief, this is getting boring, even to me.