The side stand switch only provides power to the run switch when it is up.
Otherwise, the neutral switch activates the middle relay. Your trouble could be the neutral switch (on the left side of the gearbox), or the middle relay (called the "sidestand relay", but activated by the neutral switch), or very simply the connector to the neutral switch which gets dodgy and crapped up under a little rubber boot behind the starter.
I would start by cleaning the connector. Others have been able to remove the neutral switch and clean it even getting better service from it by switching gearbox oil.
It's not the side stand switch.