The days of "underrated" HP are gone. The combination of J2723 and J1349 requires that the rated HP be an accurate number. Previously, interpretations and loopholes allowed manufacturers to underrate or overrate their engines slightly. Long ago, they were able to do so by large amounts.
But now the rated number is the actual number, and production models are not allowed to vary from the rating by more than 2% in the U.S. and 5% in Europe.
If the dyno shows a number which results in someone believing that the engine isn't within 2% of the advertised HP, then either their assumed drivetrain loss is wrong, or the dyno isn't accurate, or something went horribly wrong in the production of that one specific vehicle and it is not the norm. The first two are most likely with today's production tolerances.