The bike has 3 switches that are for safety concerns. Kickstand/Clutch lever/Neutral. It sounds like your kickstand switch is bad or maybe has come loose of it normal spot.
The circuit is broken and no start.
I have a TW it sometimes dies when I put the stand up, not always, I just put it down and back up and it goes.
Now my XR650L had a hard start problem for 10 years, I came upon a YouTube video of my exact problem. Now the baby starts every time without trouble.
It has a weird wiring issue and it won't start if cold, well maybe after 5 minutes of trying and the battery is almost dead. Well, NW Adventurer had the answer.
He shows it on his video, if you put the stand up, it fires right up, stand down, it won't start.
The bike is very tall and I have always started it after getting my gear on. I've had trouble since buying it in 02, I would stand there and crank on it til hell froze over, no start or it would back fire like a bomb just went off.
Now I choke it half way put the stand up hit the button and she purrs to life. Put the stand down and get my gear on while it warms up.
Yeah, I can work with that.