Graphics.Blit(...) or CommandBuffer.Blit(...) strange results.

I am trying to bake a shader results to a texture and save that to a file based on Ronja`s tutorial:

private void RenderTextureFromMaterial(string baseColorTextureName, Material m_material, int pass = -1)
    {
        RenderTexture m_renderTexture = RenderTexture.GetTemporary(Resolution.x, Resolution.y);
        Texture2D m_texture = new Texture2D(Resolution.x, Resolution.y);
        Graphics.Blit(null, m_renderTexture, m_material, pass);
        //transfer image from rendertexture to texture
        RenderTexture.active = m_renderTexture;
        m_texture.ReadPixels(new Rect(Vector2.zero, Resolution), 0, 0);
        SaveTextureToFile(baseColorTextureName, m_texture);

        RenderTexture.active = null;
        RenderTexture.ReleaseTemporary(m_renderTexture);
        DestroyImmediate(m_texture);
        DestroyImmediate(m_material);
    }

This code works fine in URP:
8227677--1074912--Noise_Color.png

But in HDRP I get this image:
8227677--1074915--ShaderTest_Color.png

And when I use Pass 7 (GBuffer) of the material, I get this result in HDRP:
8227677--1074924--ShaderTest_Color.jpg

Even when I use CommandBuffer.Blit() I can not get the results like in URP:

CommandBuffer cb = new CommandBuffer();
cb.Blit(m_texture, m_renderTexture, m_material, i);
Graphics.ExecuteCommandBuffer(cb);

The top-right version of the generated image is not the correct one too, its a zoomed version of the correct texture of the material.

how can I get the correct result in HDRP? Is there anything I am missing?

I have the same issue. Have you been luckier than me and found a solution yet?