Precision high speed peak detector
Precision rectifiers at high frequency are surprisingly hard, as you are finding out...

The tricky bit is, what does the amplifier do when the diode is non-conducting?

In the second circuit, we can infer what's happening from the zoomed-in waveform.

When the diode is off (V1 &lt; Vout) the opamp Vin+ input is below Vin- and there is no NFB, thus the opamp is effectively open-loop, instantly driving its output hard against the -ve supply rail.

When Vin+ goes positive again (exceeds Vout,Vin-) the opamp recovers from this condition and slews its output positive as fast as it can... and JUST starts charging C as Vin+ falls below Vout. (You can see the tiny charging spike).
If you can add a simulator trace on the opamp output, you'll see this happening more clearly. (Update the question with the plot, maybe!)

(You can reason similarly about the zero-crossing distortion in the first circuit, though the error is limited to the forward voltage across D1, therefore recovery is relatively fast)

So what to do about it? Essentially, ensure OA1 never loses control quite so badly. A high value resistor and diode in series, across D1, (the diode having the opposite polarity) will ensure the opamp output remains only 2 diode drops from the output voltage, giving faster recovery (but not infinitely fast) This will load C1 a little, thanks to the resistor. 







simulate this circuit &ndash; Schematic created using CircuitLab

Alternatively, use two diodes in place of D1 - one charging C1, the other as part of the feedback network above (which becomes simply 2 back-to-back diodes, there is no more need for the resistor). In this version, there will be imprecision from the mismatch between the two "D1" diodes; relatively small compared with what you see now.







simulate this circuit

When D1 conducts, D3 keeps Vin- at (approx) the same voltage. When D1 turns off, D2 keeps the output somewhat under control.

There may be ways of fixing or improving the original circuit, now that you know what you're looking for.