Motorcycle Questions? Ask a Mechanic.
Hi and welcome to JustAnswer,Thank you for the question and your patience. Should you still need assistance for information purposes only...Initially, it would appear to be a poor ground, loose wiring or connector issue.
Still and if have not been tried; inspect the battery, its ground lines and/or check/clean the battery cables + terminals, connectors and wiring as a preliminary consideration. Have the battery externally charged and then LOAD TESTed (even if new/charged and just for the purpose of eliminating it as a suspect).
Particular attention to all black wires including those tied to the battery's - terminal, harness to frame and engine ground.
Additionally, consider to hardwire a secondary ground line from the battery's - terminal to the engine. frame and harness' black wire(s).