The assertion is false. For , take the affine hypersurface
It is an integral scheme, and its only possible singular point is the origin, which has codimension two. Hence it is regular in codimension one; as a hypersurface it satisfies Serre's condition , so the Serre criterion for normality also makes it a normal scheme. The Divisor class group of an A-type surface singularity is
generated by . Thus a closed affine subscheme satisfying can have nonzero torsion in its class group.
Write . If , its prime ideal has height one and is generated by an irreducible polynomial , because is a unique factorization domain. Then is a principal open subscheme and
If , its complement has codimension two. Since is normal, regular functions extend across that codimension-two subset, giving
This includes the calculation for the punctured affine plane. If has dimension two, then is empty and its ring of sections is the zero ring.