We need more information to be able to troubleshoot the problem. Could you attach some photos of the wiring or better yet draw a diagram of wiring so we could have a look and see what we can find?
We can not see very many of the wiring connection details in the photos so here is some general advice regarding the installation.
These are the only required connections in order for the controller to operate.
We can see that you have already wired some of the connections listed above however in the interest of completeness we wanted to include all of the required connections in our list.
That type of problem is usually caused by old or worn out batteries.
We have a battery pack load testing guide that can be used to help determine the battery pack's condition at this link: https://electricscooterparts.com/loadtest/index.html
If the battery pack Voltage drops to zero when the power switch is on then the batteries are no good and they will need to be replaced.
One of the batteries probably has an open cell which is causing the problem.