Replacing the alternator fixed other issues due to the low voltage output and possibly bad/dirty connections.
It is possible the vehicle in question has the system that partially disengages the alternator to save on fuel when the battery is fully charged. So, the alternator could have been running full tilt all the time and thus contributing to the low fuel mileage.
But that isn’t the entire answer. The above comments about low votlage to the and perhaps dirty connections are more likely to be the main culprits.
Also, as stated, the onboard mpg calculators are not accurate. They can be close but that is the best you are going to get. The one in my 2019 is consistently 1 mpg less than taking the trip milage divided by the gallons used to fill the tank. The same goes for the mpg average on my ScanGauge II in the 2011. At best, they are just a reference point to get an idea how the vehicle is doing mileage wise but I wouldn’t trust it as a reliable data point.