It sounds like a bad ground. When you shut off the key with the headlights on, there's voltage to the ground side of the coil, reversing its polarity. Coils still work with the polarity reversed, but if you try to put any load on it there won't be enough charge to get really good spark.