Let us say we have an equation of motion of the following form,
$$\ddot{x}=g\tag{1}$$
For this system an effective potential can be defined as,
$$\ddot{x}=-\dfrac{d}{dx}U_\text{eff}$$
$$U_\text{eff}=-gx\tag{2}$$
Now let us do a coordinate transformation of the simplest sort, i.e.
$$y=x/2$$
Under this $(1)$ becomes
$$2\ddot{y}=g \implies \ddot{y}=g/2$$
$$\ddot{y}=-\dfrac{d}{dy}U_\text{eff}^*$$
$$\implies U_\text{eff}^*=-\dfrac{g}{2}y$$
However, putting the transformation in $(2)$ directly,
$$\tilde U_\text{eff}=-2gy$$
I expected that under coordinate transformations,
$$U_\text{eff}^*=\tilde U_\text{eff}$$
But that is not the case as shown. Why am I wrong?