Elevation gain based on free mapping databases is always flawed because the free databases are usually averages over a region of land and don't consider man-made features like bridges, tunnels, or roads along the side of a cliff. Also, your computer may record your position infrequently so the course it records is different from what you actually rode. A bicycle computer with a built-in barometric altimeter and sampling several times per minute will almost always be much more accurate than a database-based elevation gain. Some Garmins can do this; don't know if yours does or not.