Why does an LED light turn on and off irregularly while the switch is in the on position?
The LED light bulb is malfunctioning and needs to be replaced.

There are several possible causes of the malfunction, but the bottom line is that it is no longer functioning according to specification.

Some stores have good return policies to handle this sort of issue.  In addition, some bulb manufacturers provide a replacement warranty.  One of those options may help you get a replacement.