1st way is electrical inside the starter solenoid when the contact washer welds to both terminals it will crank the motor until the battery runs down or u disconnect the bat.
2nd way there is something wrong and it binds the starter solenoid causing it to stay engaged. in the old days u could grab a hammer and give it a whack .
not recommended on a new bike especially since that is not your trouble.
i will take a guess
the starter relay (if they have not changed the design ) was hanging down (not in its proper position) and it got water in it causing it to short across . this would cause it to turn over for a while till the water boiled away then it would get wet again.
this should be an interesting thread so i will call one of the best electrical guys on the forum
@DEcosse
if he has the time i hope he will join in