If the clutch is slightly pulled in then problem goes away???
If so the the side stand switch is acting up and probably mispositioned. Dismout it and check the position of the tit. Better yet nypass and try.
Also there is a tilt sensor that may be a contributor.
I also had a relay dangling around on the left side under the seat cowl. It was causing my bike to hiccup.
Just kidding about selling the bike.
On education I find electrical probelms can be tricky. Most people ignore the obvious and think in terms of mysterious gremlins. Understanding the system is fist before questions.