I once had a device that worked... but only in the dark.

The problem was a sleeper -- and had nothing to do with unconnected CMOS inputs. Another time I accidentally created a situation where a program relied on the contents of one uninitialized byte of memory (which, after power-up, was unfortunately about 95% consistent).