I’ve had it happen to me a handful of times. I checked KTM forums as well. Besides lots of kickstand cases I also found cases of clutches dragging. If the clutch isn’t fully disengaging it can cause the engine to stall when you clutch in.
When I took delivery of my bike the clutch cable was WAY out of adjustment. I spent a few minutes adjusting it but never compared it to the manual spec for free play. I saw a few cases on KTM forums where guys said adjusting the cable and leaving the lever at the longest setting ended their stalling issues.
Check your kickstand switch and clutch adjustment!