The law of gravitation is $$F=-\frac{GMm}{r^2}$$ Where $F$ is the force exerted by $M$ on $m$ and vice versa. The gravitational potential energy function can be derived from the law of gravitation. Lets assume $M$ is the mass of the earth and $m$ is your mass. The force the earth exerts on you will equal your mass, $m$, times the acceleration due to gravity at the surface of the earth, $g$. We can calculate $g$ from the following $$g=-\frac{GM}{r^2}$$ Where $G$ is the universal gravitational constant = $6.674x10^{11} N.kg^{-2}.m^2$ $M$ is the mass of the earth = $5.9742 x10^{24}kg$ $r$ is the radius of the earth = $6378 km$ at the equator. Which gives us using proper units, $g=-9.8 \frac{m}{s^2}$ at the surface of the earth. Now, when we apply the equation $GPE=mgh$, it is the difference in the gravitational potential energy of $m$ between the surface of the earth and the height $h$. $g$ can be assumed to be constant provided $h$ is negligibly small compared to $r$. If it isn’t, then you would need to redo the above calculation to determine a new $g$ using a new value of $r$ Bottom line, the $h$ in $mgh$ is not the same as $r$ in the gravitational potential energy equation. Consequently an increase in either $m$ or $h$ results in an increase in gravitational potential energy near the surface of the earth. This does not contradict the gravitational potential energy function. Hope this helps.