Where G has a direction and H has a direction.
The gravity direction is downward, and the downward direction is selected as the positive direction.
Then the rise of H, the displacement is -H, and the work done by gravity is -—mgh.
Descending h, displacement h and gravity work mgh.
So the total work done by gravity w =-mgh+mgh = o.
Who taught you that?
This is calculus. I just learned it in college, and I also said some math in Grade Two.
Actually, it's exactly what I said.
But there is something wrong with your supplement. Not that the cumulative force is O, but that the cumulative displacement is zero.
H in mgh is the displacement. When it returns to its original position, the displacement H is zero and the work done by gravity is zero.