Being loved "to the moon and back" is not an assertion of endless affection.
To the moon and back is a long way, yes, a long trip, a long time, and love should be long. However, “I love you to the moon and back” is not an assertion of endless affection or adoration but a certain declaration of intent to break up.
The moon is 238,857 miles away, on average. At perigee the moon is 225,622 miles out and 252,088 miles at apogee. While that is relatively far, half a million miles or so there and back, it is still a finite number. It sets a deadline, an automatic limit, which means eventually the trip will end. The trip will end and after that all bets are off, and chances are so is she. Or he.
Admittedly, it’s better than “I love you to Cincinnati and back,” but not by much.