Incorrect elevation on course preview and in elevation graph

I have some courses that I sync through Garmin Connect. On Garmin Connect it shows 259m of total ascent. On my 1040 however it shows 956m of total ascent. When riding the course the elevation profile on the map also shows red/black zones indicating steep climbs, that are not present at all. ClimbPro also shows climbs that aren't there.

At the end of the ride however the actual ridden elevation is correct (around 259), so it's purely a map/calculation problem and not a recording problem.

I'm running firmware 21.18

Any idea what's happening? Screenshots attached: