Welcome to the site.
Don't assume anything. Prove it with data.
If you have a DVM or VOM, buy a couple of alligator clip leads. Mount the meter where you can see it above the handlebars. Remove a patch of insulation on each power wire to the controller and install alligator clips. Read voltage standing still to prove connection. Ride. If voltage drops below 15% rating for your battery (see lunabike tables) then a connection or the battery is at fault. If not, the controller is at fault.
If controller is good, you can reinsulate the wires with shrink wrap tubing or 3M windshield adhesive.
More to the point, you can test the battery separately on a concrete step with the same meter , clip leads, some 12 ga wire, and a load resistor. Batteries frequently develop bad welds internally. I bought 2 five ohm 225 watt resistors at a surplus website and hooked up in series to test my 48 v battery at 4.8 amps. Use them otherwise to test PA amplifiers. Battery failed even though fully charged. Collapsed to 11 volts from 52 with load. Bought another one.