Thanks Petri...long winded but the content the Blitz has come to expect...and deserves...

...

...
While I don't know of any reason those weapons should possess different ranges, ballistically speaking, I think you may have hit on a possible explanation, that being optics. I suspect the PAK 40 used iron sights or a barlow scope, whereas PZ IV's and most all German WWII tanks used rangefinder (stereoscopic or binocular) vision aids.
Specific to late war PZ IV's and Stugs I know many were re-fitted with longer caliber (48 vs. the original 40 length) and this would help explain the better longrange capability. Many, not all.
The PAK 40 was a unique animal that served well throughout the war which at first stymied many Allied ballistics experts until it was discovered that the rifling on those AT barrels actually had increasing twist (from 1/18 to 1/24, breech to muzzle). This would cause the muzzle velocity to drop slightly, but one must assume this would have increased downrange accuracy.
A possible (but confusing) explanation for different range capabilities?
:whis:
Years of handloading my .270, 30-06, and 7mm Mag have taught me that all bullets find a peak accuracy somewhere well below their maximum velocity. Eventually you push the round so hard you lose rotational stability, resulting in increased spread. In the worst cases "key holing", or the case where the round has begun to tumble in mid-flight are the result. It's possible this was the reason for the variable rifling.
Then again it could be the designers were accounting for something as simple as a solid (one shot) breech block design vs. a gas operating semi-automatic ejection system.
Only theorizing here...of course...