I'm the original poster and I'm glad that the post has stimulated such an interesting discussion. I just found something else of interest: looking back at my records, I found a couple of rides in 2016 which I tracked using both Strava and the Samsung S Health apps. On the first ride, over a 23-mile course, Strava recorded the elevation gain as 1299 while Samsung pegged it at 1721. On the second ride of 17 miles, Strava recorded a gain of 892 feet, while simultaneously Samsung gave me 1381 feet. The phone I was using at the time was probably a Samsung Galaxy S8. So here are examples of different apps on the same phone at the same time giving wildly different reading of elevation gain.