Why do you assume your iPhone X is correctly capturing measurements? All GPS devices are incorrect to some extent. As to the half marathon, did she run the tangents right and exact to every turn? Did she not weave around any runners? Because races are measured by a wheel to the tightest tangent and the straightest line and they’re not certified based on GPS. I have been running for 24 years and never once has a half marathon/marathon (of which I’ve run over a dozen) come out to 13.1 or 26.2 on a GPS watch—because of those factors.
Maybe the watch is wrong. Hard to know without a 3rd device to use as a proxy. Either way -- one of the two is off by a sizable distance for our hike. A 0.3 mile discrepancy for a hike under 2 miles is enormous.