The main problem with Ducati charging systems is that the stator wires are way undersized and the in-line connectors develop a high resistance, heat-up and melt.
The rule-of-thumb for sizing wiring is that if it needs to carry 20 amps use 12 gauge wire; 30 amps needs 10 gauge; 40 amps needs #8 gauge. Early bikes have 350 watt/29 amp two-wire charging systems so 10 gauge should be used. Newer three-wire 500 watt alternators can produce a little over 40 amps. So you ought to replace the wiring all the way back to the stator with 8 gauge wire.
These wires have to pass 30 amps or more continuously. There’s an electrical phenomenon called I-squared-R loss. That is, if you run 30 amps through a corroded or loose connector having (say) a 1/2-ohm resistance, the heating effect is 30 X 30 X 1/2, or 450 watts. That’s a lot of continuous heat. This heat just conducts down the wire, cooking the insulation as it goes.
Just like you can’t put your hand on a 450 watt light bulb while it’s lit, you can’t expect a plastic connector to survive radiating 450 watts of power either. A corroded or loose connector always has a higher resistance than the adjacent wires and it will heat up enough to melt connector plastic parts and nearby wire insulation. That’s why it’s best to solder the wires directly together and eliminate connectors entirely.
It is the connectors heating up that causing the insulation and conductors to melt and short out. Even if you haven't had a charging failure, next time you have a chance, check your wiring for damage.
On my 916, the stator wires got so hot that the insulation became brittle and cracked near the regulator connectors. A closer examination showed that the damage extended along the wire all the way back to the engine casing. I could scrape off the softened insulation with my fingernail. Rewire it.