It seems that docking beams will hit the entity docked on your target even if that docked entity is not visible to you (->targeting a block but hitting the docked ship behind)
Beam works normal if there isn't anything behind
{F3208}
Beam hitting the docked blocks behind (has nothing to do with the glass blocks, it will pass through as many blocks as there are if the docked entity is in range of the beam)
{F3210}