FWIW, the BMW sidestand switch and clutch switches are completely different, and are not interchangeable.
This is what the sidestand switch looks like. It is NOT a microswitch!
I would try bridging out the sidestand switch to see whether the issue persists. If it does, then you have a fault elsewhere in the harness. If the issue is resolved, you then have a choice to either just leave the switch bridged out (which creates a bit of a safety issue) or to replace it with a new one.
You can bridge it out by unplugging it and then shorting out these two pins on the harness side of the connector.