Unit Gain Op amps not working LM2904p
Your circuit (cleaned up) is not a voltage buffer – for that, the negative feedback is missing:

Comparator

(your circuit, minus the supply voltage, and minus the avoidable crossings)







simulate this circuit &ndash; Schematic created using CircuitLab

Remember that an opamp really just does (idealized, without phase shifts)

Vout = (V⁺ - V⁻)·a

for some large a, e.g. a=10⁵. Your V⁺ - V⁻=2 V, so Vout = 200000, but limited by the supply voltage.

Your circuit is working 100% as expected!

Voltage buffer

(the negative feedback means that the opamp tries to achieve V+ = V-, and that can only happen with Vout = Vin)






simulate this circuit