Does "everything was the same" include the two zoom values? Were the two pictures of exactly the same scene, no camera movement?
Probably so, in which case I should have kept quiet. And we probably should see your pictures to have much clue.
But the zoom values determine the expanse of background seen, and the background affects the metering. And backgrounds of direct flash pictures are often dark behind the near subject, so it's not unusual that direct TTL flash is often overexposed some on the near subject, trying to light the dark background too.
Then, even if the two zooms and backgrounds were the same, then the default TTL BL flash mode watches the D lens focus distance from the lens, and can cut back on the direct flash, actually expected for the reason just stated. Your Exif should report the focused distance for the two lenses, not necessarily the same. This D lens distance on zoom lenses is of very questionable accuracy.
Bottom line, expecting flash to always be accurate will be disappointing. It might be ballpark, but rarely exact. What works better is to watch what it does, and then to compensate (flash compensation) to instead give what we want.