As far as I can tell, for every pair of units in the game, the sweet spot is always at the extremes. I can't think of any exception where this rule doesn't apply. Heavy sappers, maybe?
Obviously, for the unit that has to go up close to win, actually moving all the way to point-blank range ends up hurting you, because you lose DPS due to moving, and you are potentially losing cover.
This is why for close-range units like Panzergrenadiers, that can actually DPS until far enough, often the best strategy is to sit at mid-range. That's because you still win, and there's potentially more cover for you to choose from.
This is not entirely true, for example the sweet spot for fighting against shock troops with either long range unit like grens or mid range unit like pgrens is around range 17 becouse this is where shocks stop to deal any statistically important damage. At the same time both grens and pgrens deal more damage at range of 17 than at extremes of 0 and 35. So in fact it is not in extreme but exactly in the middle.