Incorrect elevation Gain / Elevation

Hey guys, how are you?

need a little help, i have a garmin edge 830 that always has the wrong altitude gain.
On the end of a ride i have like 500meters of altitude gain and i know thats wrong, people that went in the ride with me have +1000m.

Also, when i upload the ride to strava and i correct the altitude sometimes i go from values around 500m to 1200m/1300m (in strava).

So this is a huge difference.
Also, when i am riding ... there are roads that i see ithat i am climbing (something like 1%~3%) ... soft climbs, and on garmin i see that the gradient is 0% or -1% .. something like that. it's never correct. However the distance/speed of the ride is good and correct.

Trying to solve it i set the elevation of the GPS a few times manually .. but it doesnt seem to correct this issue.

Any ideas on what i can do?