I am focusing on the bike as a whole. You should get more than 5Km out of a battery that size.
Yes, if your motor is damaged, it can reduce range.
If your tires are badly underinflated, it can reduce range.
If your controller is badly providing power, it can reduce range.
If you climb a lot of steep hills, it can reduce range.
If you are hauling a trailer behind you, it can reduce range.
If you are an exceptionally heavy rider, it can reduce range.
If you are travelling into the direction where you are working against a strong wind, it can reduce range.
But, the simplest answer (if none of the above apply), is that your battery is not performing at the Amp Hour (Ah) rating on it.
Motors do spin slower, as the battery voltage drops; this is quite normal. My bike is slower on the last couple of bars, (which indicate battery voltage), than when the battery is fully charged.
The question is, how far can you go before you are down to the last "bar" of power on your display?
Is it more than 5Km? If so, how far total distance can you ride?
All eBikes will spin the wheel faster, when it is off the ground. This is especially true of bikes with smaller motors (under 500 watts).
This is extremely true if it is a "direct drive hub motor" (no internal gears). These are commonly called "speed motors" for a reason.
They typically can spin fast, but have less torque (acceleration rate) than geared hub motors of the same number of Watts of power.
So, the fact it spins faster when "off the ground" does not give useful clues.