Replacing LED lights with LED lights but 2 out of 5 has issues
My bet is that the middle contact isn't sprung enough to be consistent. 

First, turn the breaker off. 

Then, gently tug at the central contact in the middle of the light fixture's socket to bend it a tiny bit further forward. Needlenose pliers can work well for this.

Don't bend it too hard; otherwise you'll have a broken light fixture to deal with.