I have an LED pool light that has multiple different colors.
You cycle through the available colors by simply turning the light off and then quickly on again.
It has always worked perfectly, and it has always stayed locked on the color I leave it on.
That is, until I replaced the simple toggle switch with an electronic timer so it would come on automatically for a few hours every night.
Now it will stick on the one color for a while, and then change.
It is completely random, sometimes it will stay on the preset color the entire time its on, other times it will change every 30 minutes or so.
Power surges are the obvious answer, but there is no reason it should be getting power surges due to the switch change.
There are no loose connections.