Bug with RenderTexture and Postprocessing

I have this look and I need to use a rendertexture to render it to a ui element:

When I add a render texture to the camera and add it to a rawImage, and change the color format to:
image

With clear flags (depth only) on the camera, it repeatedly adds the effect over and over like this:

And eventually looks like this:

If I change clear flags to Solid Color it loses the postprocessing effects and looks like this: (but I do need to use clear depth because I have a background going behind it)

What should I do differently?