Matthew has it right. Voltage sag will cause the bike to shut off when the nominal battery voltage is 42-44 volts, above the 40V cutoff you may expect. It's always there, and if you have the means to view it on your meter when riding, you can see the difference between being under power and not,
A brief hill encounter might drop the voltage 3 volts to the bike. At full charge, no big deal, but when you're at 30%, or 43 volts on the battery, the bike will shut off, Sag is nonlinear too, so what might be 3V at full charge is higher at half charge, If you have no such hills, or compensate by pedallng harder, you might get another 30 miles, 20 miles for sure,