Cool. I don’t know much about military stuff, but it seems like a countermeasure would be to locate the cannon based on the last known position of where a swarm was shot down, and either shell or bomb the area to get the cannon, which will be expensive. Until all other kids mass produce it.
You may not know the direction of attack against the drone swarm so your initial guess about the laser’s position has a huge uncertainty. If the laser is effective to, say, 5 km, then the laser’s position could be anywhere in a 5 km radius of the swarm. You can’t target with information that imprecise.
Laser defenses are becoming potent enough that they will soon be able to destroy bombs, cannon shells, missiles, and aircraft in flight. At a certain point of development and effectiveness, the costs of laser defenses versus incoming projectiles and weapons shifts in favor of lasers under a broad range of conditions. As that happens, defensive lasers will tilt the strategic balance in favor of defense — at least for wealthy and technically proficient societies.