Let's try another way.
To get best range one should fly to maximise ((L/D) times VTAS)
For climb and early cruise this means flying at the maximum allowable airspeed, that is close to Vmo.
Vmo is obtained by applying statutory margins to the flutter clearance speed which is itself dependent on IAS (not Mach). Vmo is therefore defined by IAS limits and to optimise performance one should fly to IAS. This is usually a constant value invariant with altitude
As altitude is increased at constant IAS the Mach number increases and eventually one gets to the point where Vmo coincides with the wing design Mach number
If one exceeds the wing design Mach one risks encountering buffet ad/or drag rise which will screw up the L/D part of the range parameter. In such conditions the maximum usable IAS (VTAS) is limited by Mach number.
One could of course fly to a prescribed IAS schedule, but it is much simpler to just fly at constant Mach.
I know one can then fiddle with the selected Mach number to optimise for long range or hig speed cruise, but this does not change the basic argument.