Might help to know what scooter. I do question the scoot still running with battery disconnected if the kill switch works but it is possible. Lawn mowers work that way and you might have a magneto. But you might also need a new switch or cleaning. What year bike would also help. Do you have a owners manual? It might be working as designed. Without vital info it's hard to say. We don't need to know what color it is but certain info does help.
I don't know much about scooters but here's what I think.
The tumblers or locking mechanism for the ignition sw could be worn out allowing key to be removed in the 'ON' position.
Such was the case with my Sporty and did not know why the battery was always 'low' till one day I came back out to the
bike, key in jeans pocket an headlight on, like what the hey Gomer? I was in the habit of using engine run sw. to kill the
engine, then took out key, there were 3 positions, lites only, lites and ignition, and off
The scooter has to have a magneto if it stays running with no battery, and the kill sw. is between magneto and ignition coil,
after coil are the points.
I think this is happening, there is a magneto not for ignition but to charge battery, this wire from mag would go to
the R/R rectifier regulator or maybe just a rectifier then to battery + and from bat + to ignition sw, then to harness.
Now with no battery and bad ignition sw. with engine running because engine run sw. is on, power is coming from the mag,
being changed to D.C. then going to bat + but if line from rectifier went to harness after the ig. sw. the battery would still
be charged. I have seen diagrams where the charge line came after the ignition sw and before it, as long as the ig. sw. is
between bat+ and harness, and ig. is good, then t's all good.