Body grounding methods abound with El Cheapo...
The mounting nut might not be tight...or touching with a high resistance
The tab that is supposed to touch body ground may no longer have proper spring tension...therefore poor connection with high resistance
Dirt/water/etc gets into the contact area to corrode it and make a high resistance connection
That list goes on and on
Proper grounding is a dedicated 'wire' with proper UL/CSA/etc approve wire and connectors...along with approved methods on installation. That all costs more than an El Cheapo pushed on light with a spring clip to hold it in the hole...that also serves as the ground point...some times that spring clip is supposed to knife through the El Cheapo paint on that mounting hole edge...some times it does, some times is doesn't...some times it only kinda sorta does...
Most intermittent connections comes from body grouding schemes...