In the provided repro project, there is an error on line 32 in "test2.cs" where "_MainTexture" should instead be "_MainTex", to match the property in the shader.
With the error fixed, it looks like both cubes are indeed green and tex2D / UNITY_SAMPLE_TEX2DARRAY sample in the same way.