Sometimes you may encounter an op amp output problem called output phase reversal, when the input common-mode voltage is exceeded. This is usually the case when one of the internal stages of the op amp no longer has enough bias voltage and then turns off. This will cause the output voltage to swing to the opposite rail until the input returns to the common mode ranges as show below (in a voltage follower). Please note that the input can still be in the supply voltage rail, but only above or below one of the specified common mode limits.
Phase reversal often occurs when the op amp is configured as a unity gain voltage follower. In the inverting mode, phase reversal is not a big problem because both inputs are constant and at ground ( or mid-supply in some single supply applications).
To avoid phase reversal, you should make yourself aware of any notes on the datasheets before designing your circuit. Some will mark in the “Key Features” table, but not necessary in the specification table. For example, Analog Devices’ AD8625, AD8626 and AD8627 op amps’ datasheet, below, shows “Key Features” and “Absolute Maximum Ratings”. These op amps have an input voltage range between 0V to +3V (maximum) when operating in a single +5V supply. So its datasheets mark “no phase reversal” means that the output will not exhibit phase reversal in the common mode region of +3V to +5V.