The ground should not be connected to the circuit of the timer, or whatever device is plugged in. It is connected to the metal case, if the internal circuit accidentally touches the case or arcs onto the case the current is suppose to return to ground. The circuit does not know if the neutral is going up as compared to the hot or the hot is going down as compared to the neutral. The diodes used to create dc for the circuit to function will work just as well with the wires flipped either way. I am pretty sure it would not cause this problem but I messaged my brother on it, he designs lighting and ventilation control equipment.