Seamless 2D SubViewport portal effect

Godot Version

v4.3.stable.official [77dcf97d8]

Question

I am working on a platformer game featuring a seamless portal effect.

The code is hosted at: GitHub - kit-solent/refrigerate
The commit at the time of writing this is: forum question commit · kit-solent/refrigerate@d2489c3 · GitHub

If I end up doing more debugging work on this then using this commit will mean you won’t have to try and comprehend my messy temporary debugging attempts.
git clone https://github.com/kit-solent/refrigerate.git && cd refrigerate && git reset --hard d2489c3

The idea is that the portal would be so seamless that the player could pass through one without knowing. I am struggling to correctly position the view into the target location. I also don’t know how to make the background of the portal view black like the rest of the world. Currently when you look through the portal (from the left side) you see the little label at the origin saying “portal2” when you should be seeing the grid of map tiles up where the 2nd portal actually is. The relevent scenes are: res://portals/portal.tscn (the portal scene), res://core/player/player.tscn (the player), and res://levels/level1.tscn (the world in which the portals and player are located). I am hoping the effect I am going for will be pretty obvious upon running the game but if further clarification is needed then I’m happy to try explain in more depth.

Thanks in advance for any help.