From:
https://mechanics.stackexchange.com/questions/38926/what-happens-if-i-disconnect-the-battery-while-the-car-is-running
"Your battery does more than just provide electricity. It also shorts AC spikes and transients to ground. Removing the battery from the circuit allows those spikes and transients to travel around, endangering every semiconductor circuit in your car. The ECU, the speed sensitive steering, the memory seat adjustments, the cruise control, and even the car's stereo.
Even if your computers and stereo remain intact, in a great many cases removing the battery burns out the diodes in the alternator, necessitating a new alternator. If disconnecting the battery interferes with the voltage regulator's control voltage input, it's possible for the alternator voltage to go way over the top (I've heard some say hundreds of volts), frying everything.
Even the initial premise was wrong. If you disconnect the battery and the car conks out, you don't know if it conked out due to insufficient alternator current, or whether the resulting transients caused your ECU (the car's computer, which controls fuel mixture, timing, and much more) to spit out bad data, shutting down the car.
Nobody should EVER run your engine without a battery.
And yet when you tell them not to, they'll roll their eyes. "I'm a professional. I do this every day. It's fine!" They'll sound so authoritative. So commanding. So in charge. So intimidating. But they're wrong.
The problem, of course, is that disconnecting the battery doesn't always damage something. It does it only sometimes. Less experienced jump start professionals and automotive technicians figure if they got away with it a few times, it must be OK."