Think of render textures like offscreen window surfaces.
When you clear, draw, display on it, the content remains permanent.
When you call clear again, everything is overwritten with the provided color.
From your code, I don't fully understand what you're trying to achieve, since you never actually draw anything to the render texture.
Personally, I'd not interleave the window rendering and render texture rendering.
Draw everything you need to the render texture, then use that texture to render to the screen.