The glide when heavy or light is complicated when a fixed airspeed is flown (eg the C152 60 knots) which means that if the best speed changes with the weight but you fly a fixed IAS then you will not necessarily be flying the right speed. If the variation is great enough then you will see that the performance will not always support the statement that weight does not affect range.
An example is the 737-200 which flies normal descent at 250IAS. At a light weight the best speed might be 200 thus the gradient will be steeper than optimum. If the airplane is heavy though, the speed will be closer to best glide so the gradient will be less steep.
Nowadays we fly ECON speeds which change with the weight, so the effect is not so pronounced.