Using Viewport Texture with Compositor Effect

Godot Version

4.3

Question

I’m creating a viewport and camera on the rendering server (code only, no nodes) that is meant to capture certain objects and store them into a texture, that I can input into a compositor effect, for further processing and eventual display on the screen.
It kinda works. The issue though is it only seems to capture the viewport initially and then never updates it, even though I am calling the code to update it every frame.
The only time I can get it to update the texture is if I disable the compositor effect and then re-enable it. But even in that case it only updates it once.

Is this a known issue? Is there some way to fix it? Perhaps I just missed something?

I have created a stripped-down project here to illustrate the issue.

Thanks!