Happens for both beams and cannons but I'm unable to see a pattern in it.
If cannons or beams have more than penetration depth per group, it seems that some damage is lost if multiple instances have to be added up to kill a block.
It's a lot worse for beams than cannons, I did test this out for armor blocks which means beams add their damage up anyway. I've only killed 800 EHP out of the 1500 EHP it should be able to damage which is very odd.