Leaving weapons unattended like that is a recipe for disaster. Even worse if they're network-connected (look at the tons of insecure IoT devices already out there).
That is a far cry from the consequences of leaving a M240 around, which is both man portable and consumes the incredibly common 7.62x51mm NATO cartridge.
Which is something the US actually tried. https://en.wikipedia.org/wiki/Bat_bomb
In this particular context, if you're thinking of WWII, it's kind of odd for a person not to think of and compare the concept to https://en.wikipedia.org/wiki/Fu-Go_balloon_bomb
This could be due to some agenda to shame the Allies for their involvement in WW2, or it could just be because WW2 is really the only time in history it was done on that scale and the Allies happened to win the conflict.
I'm going to go with principle of charity and assume the latter...
Drone swarms are coming once the technology gets mature enough, mostly in speed and carrying capacity.
My next thought is that programmers do have an opportunity to take moral stands against some of these things. We can't stop someone somewhere from building these terrible things but we might be able to make it harder by preventing huge problematic privacy invading data sets from existing.