I'm trying to add a simple minimap but there's a problem I can't solve: The contents for the SubViewport are displayed only in the editor preview but disappear once I run the scene.
My guess is that your camera.position calculation within the SubViewport script is off, making the camera go off bounds of your minimap texture and just shows a blank background instead.
If you remove your Camera2D from your SubViewport for a second and run the game, it will probably make the image appear during runtime the same as in you see it in the Editor.
Not sure how you designed your minimap texture, but usually minimap would be much smaller than the actual world space. That means you can’t just take the player’s position as it is, but you need to scale it down (and maybe also translate it) to match the scale and position of the minimap texture within the SubViewport.