Render target asset behaving differently to code created

Looks like this was just a bug on my part in the end - the code wasn’t correctly setting the new material instance back into the portal surface mesh.

I’m making a portal system using a USceneCaptureComponent2D with its UTextureRenderTarget2D applied to a plane mesh with this material:

201672-matgraph.png

As long as the render target I bind to the material instance is an asset in the editor, everything works fine (the portal view pans correctly with the camera). However, if I create an identical (as far as I can tell) render target in code and assign it to the material instance, the panning ends up inverted:

SceneCapture->TextureTarget = NewObject<UTextureRenderTarget2D>();
SceneCapture->TextureTarget->ClearColor = FLinearColor::Transparent;
SceneCapture->TextureTarget->InitAutoFormat(1920, 1080);
// Without the above lines, TextureTarget is the editor asset and it works.
SurfaceMaterial->SetTextureParameterValue("RenderTexture", SceneCapture->TextureTarget);

Does anyone have any idea what might be causing this difference?