Shader doesn't work as intended as part of a bigger scene

Godot Version

Godot 4.2

Question

I’m still learning the basics of shaders so a lot of stuff doesn’t fully make sense to me yet.

I tried recreating with very little changes a simple distortion 2D shader I saw from a tutorial. In the viewport for the scene it looks to be working fine. But when I drop it in another scene, it completely destroys it – it just looks like a transparent blur. When I zoom in the viewport it seems to fix it.

My question is what am I getting wrong and how to fix it. If it has something to do with the shader affecting the background, how do I make it so it only affects the scene it is a part of.

shader_type canvas_item;

uniform sampler2D noise: repeat_enable;
uniform sampler2D screen_texture : hint_screen_texture, filter_nearest;


void fragment() {
	float offset = texture(noise,UV+TIME/50.).b*0.009;
	COLOR = texture(screen_texture,SCREEN_UV + offset);

	}