I have 2 recessed can lights that are controlled from the same wall switch. I replaced both with LED bulbs. After several months, in one of the lights the bulb would go off and on intermittently. I replaced the bulb with the same result. After about 3 weeks of this pattern the bulb will not work at all. The other fixture on the line has had no issues.
It sounds like the the center contact has loosened up in the fixture, with the power off pry the contact up a little and that may solve the problem. There are usually temp sensors in can lights but since changing the bulb made it work for a while I would check the center contact on the fixture. LED's usually will not produce enough heat to trip the thermal sensor. It could be a loose connection in the wiring, but again, since changing the bulb made it work, check the center contact.