The length displayed when selecting a segment is not the segments "true" length - this value is displayed from a length that is rounded to whole meters and displayed (or if your WME setting is Imperial, converted to feet which amplifies the rounding inaccuracy).

This script calculate the geodesic length of the segment and displays that in both feet and meters (because why not show both!).