Important!
Get Locus Map permission for all-time access to location and exclude it from all means of battery optimization so that the app can run and access location data in the background. Instructions on how to do it are summed up here or here.
Locus Map processes location and elevation gain from the data it receives from your phone GPS and other location/orientation sensors. If the data is incorrect or contains deviations, the resulting location fix and elevation gain are incorrect. Locus Map, however, offers a few methods on how to limit these deviations.
Open Locus Map settings > GPS&sensors and set the following
Sometimes it happens that the GPS chip is malfunctioning or terrain/weather conditions are so demanding that elevation data is incorrect even after applying the measures mentioned above. Then try the following:
Those who are still unsatisfied with the result can change the elevation gain calculation by applying a custom altitude threshold: