Rectifier failed...bad terminal connection at battery if battery selector switch, bad cell in battery, loose battery connections, bad connections at rectifier
If switchboxes are not OEM, Serria, CDI or Prufrex they can be bad and act good due to bias circuit. I have had 4 customers return the Amazon Chinesem junk this month and I replaced with Serria (warranty)