what year is it? is it one where the ignition system requires the battery to run?
i have the '78with that setup. the list of problems with weird issues was growing and increasingly inexplicable. i just replaced the whole system with one from a xl125 so it doesn't require the battery to run anything but the lights. ALL of the weird problems went away, with the exception of it not loving a ton of throttle off the starting line (stalls). for simple machines these are fickle little bikes.