New GameObject with GUITexture is a Horribly Incorrect Size

I’ve created a GameObject at runtime that I want to have a specific texture.
Here’s my code (JS):

if (!popUpVisible){
    popup = new GameObject("Popup");
	popup.transform.position = Vector3(0,0,2);
	popup.AddComponent('GUITexture');	
	popup.guiTexture.pixelInset = new Rect(0,0,315,345);
	popup.guiTexture.texture = popUpTexture;
		
	popUpVisible = true;
}

In theory, this new game object should contain a new GUITexture at rect - 0,0,315,345.
For a reason I cannot quite fathom it stretches and moves the texture so it looks ridiculous; a rect value which is closer to how it looks visually is 515,685,-650,-350 (I manually adjusted these values in the inspector to test).

I’m not sure what I’m doing wrong.
The texture is 315x345 and is correctly set as a GUI Texture.

You have to set the scale to 0 if you want it to use pixel values.