I recently managed to build a non-inverting amplifier with an op amp that acted as an inverting amplifier. I found this more than a little puzzling, and asked around for possible causes. My friends were kind enough not to laugh too much when they pointed out my error.
The problem was that the op amp I had selected, the TL974, has a rather tight common mode voltage spec. It expects the common mode input voltage to be more than a volt from each power rail. The common mode voltage is the average of the two input voltages. Since those voltages are equal (or nearly so) in the non-inverting configuration, we can assume that the common mode voltage is equal to the input voltage.
The input voltages on my circuit ranged from 0-1.8V against power rails of 0V and 3.8V. Not surprisingly, this didn't work very well; it caused the inverting and non-inverting inputs to swap places. As a result, instead of amplifying the input voltage across the intended gain of two, it shifted the signal up 1.8V and inverted it. Wheeee!
Here's a long but useful discussion of this issue on Planet Analog.