Diagnosis
The LED or its wiring is faulty. Sawdust infiltrates the light housing near the base and damages the connection.
How to Fix It
This is not a user-serviceable part. The LED is integrated into the motor housing assembly. You would need to replace the entire upper clamshell housing, which is a major disassembly.
If That Didn't Work
For a temporary fix, ensure you're using a high-output HP battery. A weak or old battery can cause the light to dim under load. But if it's flickering with a good battery, the light circuit is broken.
Heads Up
Do not attempt to open the housing to fix just the LED. The switch and speed control electronics are in there. Tampering can create a shock or fire hazard.