lm358 arranged as a 5 volt Buffer
An LM358's output cannot go up to the +ve rail, only within a couple of volts. If you ask it to buffer a 3v voltage you should be OK. If you want to buffer 5v, you need at least a 7v power supply.

... as you found with your 9v supply experiment.