The tale about classes is only true for FLYING units that are under the effect of "Berserk." Ground units behave logically, i.e., they attack the nearest unit (the distance is equal to the number of hexes the unit traveled to the moment of the attack).
The different behavior of ground units and "flyers" is related to the different ways their distances are calculated. Calculating the distance for ground units is not a problem, but how to do it for "flyers"? Here, the distance is probably determined by the difference in coordinates between the "take-off point" and the "landing point," which does not always reflect the actual distance.