Hi
I'm guessing you already checked to make sure the
12V and 120V power isn't all crossed up. If not, that would be the first thing to check.
I'm not quite clear on just where the sparks are flying out of. I'm assuming they are coming out between the bulb and socket. That sounds a lot like the base size on the
12V bulbs isn't correct for the sockets. Normally with a screw in light fixture the bulb should be very secure when screwed in. If it's a pin base then wear out is pretty common. (not clear which it is from the picture)
Normal "repair" for a light socket that's past its use by date is to simply replace it. There isn't a lot of rebuilding you can do. Cost wise. .... they should be dirt cheap.
Bob