Certain light bulbs not working in fixture
Last time I had this problem it turned out the spring in the fixture that makes contact with the bulb tip had weakened, so it only made contact with some bulbs. That's how I discovered that on some bulbs the tip sticks out a little bit more than on others.

Then right as I was thinking &quot;bad contacts can heat and start fires&quot; the thing started to make &quot;kzzzzt&quot; noises. Apparently contact was really bad.
Fix was to Turn off the breaker to the fixture and test to be sure there is no power at the fixture and then pull the spring in the socket a little bit with needle nose pliers   to make sure it made contact again. Or change the socket.
Could also be a bad contact with the wires, or a loose screw, that happened to make contact after you fiddled with it. That's another fire hazard.