Well, it's hard to tell without knowing the code, but I think the discrepency is coming from the
after applying the ship-type-specific cap multiplier (which includes the unit-cap-scale multiplier) step.
Consider this entry from 5.076
CheckWave: populating count of FighterII with base magnitude of 170
numberUnits = kv.Value * this.WaveSize : 3966.28
after applying the ship-type-specific cap multiplier (which includes the unit-cap-scale multiplier), numberUnits : 495.78
after applying UsefulnessInAIWaveMultiplier if any, numberUnits : 594.92
to this entry from 5.077
CheckWave: populating count of BomberII with base magnitude of 184
numberUnits = kv.Value * this.WaveSize : 4960
after applying the ship-type-specific cap multiplier (which includes the unit-cap-scale multiplier), numberUnits : 4858.28
(yea, I know that I used fighters for the first one and bombers for the second, but they both have the same caps, and its the ratios of the first and second step that matter)
Notice how in 5.077, the second step reduces the amount far, FAR less. There are MANY more than the increase in caps would dictate by ratios.
EDIT: It seems that Keith found not only this discrepency of the second step, but where it came from while I was making this post.