If $K$ is a field, $\mathbb A^2_K=\textrm{Spec}K[X,Y]$ and $U=\mathbb A^2_K\setminus\{(X,Y)\}$, I want to prove that $(U,\mathscr O_{\mathbb A^2_K|U})$ is not an affine scheme. I know that this topic has been handled many times, but I want to point a specific passage in the language of schemes.
I have proved that $\mathscr O_{\mathbb A^2_K|U}(U)=\mathscr O_{\mathbb A^2_K}(\mathbb A^2_K)=K[X,Y]$. Now suppose that $(U,\mathscr O_{\mathbb A^2_K|U})$ is an affine scheme, there is a ring $R$ such that $(U,\mathscr O_{\mathbb A^2_K|U})\cong (\textrm{Spec }R,\mathscr O_{\textrm{Spec}R})$; by the equivalence between the opposite category of rings and the category of affine schemes we have that $R\cong \mathscr O_{\mathbb A^2_K|U}(U)=K[X,Y]$. The conclusion is that $(U,\mathscr O_{\mathbb A^2_K|U})\cong (\mathbb A^2_K,\mathscr O_{\mathbb A^2_K})$ but I don't understand where is the contraddiction. Why $\mathbb A^2_K$ and $U$ shouldn't be homeomorphic (look here for a similar question)? Even if they are homeomorphic (I don't think so) why there shouldn't exist an isomorphism as locally ringed spaces?
The fact that the open embedding is not an isomorphism doesn't imply that there is no isomorphisms between the two schemes.