Non-inverting unity gain buffer appears to be inverting
If the valid common mode input voltage range is truly 4V to 12V (I did not check this myself) then it is necessary that your entire input signal swing must be between 4V and 12V. Your input signal looks to be at 0V on your scope trace most of the time and only goes into the valid common mode range when it has pulsed up to your ~4V level.
You should display both input and output at the same time and then compare the voltage level of of both during the pulse time to see what those levels are with respect to one another.