Without looking at the schematic, a voltage regulator needs a ground path to work properly, possibly when you removed it, that caused the starter/gen to power up using wires that were not of sufficient gauge.
in-other-words, it short circuited.
I'm sure you learned a lesson about disconnecting battery terminals when working on electrical systems.
I could tell an old story about my teenage son putting his car through the barn door by not doing a battery disconnect first about 35 years ago.
Now do remember to clean the new paint from mounting terminals of the regulator,
or it no workie