External devices (e.g. Garmin) tend to have better elevation data because they work directly with the GPS chip. They are designed and optimized for this purpose.
Mobile apps have to rely on the data provided by the "Google Play services", and these do not deal with elevation profiles very much - elevation is not important for the primary use of a mobile phone... Mobile phones are not devices intended for precise geodetic measurements...
The result is that a recording made by a mobile phone often contains a lot of noisy (inaccurate) elevation data. This has to be filtered, because simply adding up the changes between individual points of the recording can produce errors of an order of magnitude.
The biggest problem is in flat terrain, because the smoothing algorithm cannot distinguish whether fluctuations of a few meters up and down are actually the terrain or measurement errors.
In hilly terrain, especially on steep slopes, e.g. in the mountains, the calculated elevation gain is usually correct, because the individual deviations between points while moving uphill still tend to increase. Even if one point is lower than it should be, it is still higher than the previous point and therefore contributes to the ascent. With the same absolute deviation on flat terrain, however, it would contribute to the descent because its value would be lower than that of the previous point.
The elevation profile therefore has to be filtered, and every program, website or device uses different algorithms! The results will inevitably be different on each device, and unfortunately deviations of more than 20% are quite common. Some simpler websites do not use any filtering at all. They simply add up the changes in elevation between individual points, and this can result in errors of an order of magnitude.
The accuracy of the measurement is affected by many factors (one or more satellite systems, visibility of the satellites (a mobile phone in a backpack), signal reflections, whether or not barometric correction is used, etc. etc.). In general, elevation measurement is about an order of magnitude less accurate than position measurement. For position measurement, you have satellites around you in all directions, which makes it possible to calculate your position very accurately. But for elevation measurement, you have satellites only on one side - above you (there are no satellites below you underground), so the accuracy will always be lower.
It is similar to walking/riding along a rock overhang that blocks the view of the satellites from one side - the recorded position will be less accurate and will be scattered sideways. The recorded elevation will also be significantly worse.
As I mentioned, the main problem for calculating elevation gain is in flat terrain. The hillier the terrain, the more deviations remain within the range of adding them in the correct direction (ascent or descent), and the more accurate the totals are.
Example for flat terrain: you are riding on completely flat ground, inline along a river, at an elevation of 200 m above sea level. However, the recording may contain data such as: 200, 201, 203, 199, 201, 200, etc., even with a good-quality recording. With a poorer-quality recording, it may jump by as much as +/-10 m between individual recorded points. The individual points are approximately 10 m apart. If this data were not filtered but simply added up (as some websites do), it would produce unrealistically high elevation gain/loss values.
From these 6 points, the calculation would show that we climbed 5 m and descended 5 m over just 50 m of the route. In reality, however, we are riding on completely flat ground.
If you ride over such flat terrain for, say, 5 km, the calculated elevation gain will already be 500 m up and 500 m down! But you are riding on flat ground.
Such a recording requires very strong filtering to show at least small elevation gain/loss values. Achieving zero elevation gain/loss, i.e. the reality of riding on completely flat ground, is basically impossible. Quite simply, if the measurement data is wrong, the results will also be wrong...
Mapy.com uses two versions of elevation data - recordings contain measured values, while plans use values from a terrain model. These do not show such deviations (but they have other problems, e.g. bridges or tunnels are usually not part of the model), and the result is therefore different again - the elevation profile of a plan differs from the elevation profile of a recording.
Because Mapy.com therefore has to rely on inaccurate elevation data provided by the mobile phone service, it has to use relatively strong filtering. Otherwise, for example in flat terrain, it would show significantly higher elevation gain values than the actual ones. It is therefore a compromise. In your case, it shows less. Other users, on the other hand, complain that Mapy.com overestimates elevation. There are several threads on this topic here in the forum, but they are in Czech, for example here. There are additional links there.