The problem is that your structure sheaf is easily seen to not be a sheaf.

Let $k_1,k_2\in K$ thought of as sections over $\{p\}$ and $\{q\}$ then since $\{p\},\{q\}$ is an open cover for $X$ and clearly the sections $k_1$ and $k_2$ agree on overlaps, so there exists $k\in \mathscr O(X)$ with $\rho_{X\rightarrow\{p\}}(k)=k_1$ and $\rho_{X\rightarrow\{q\}}(k)=k_2$. But by picking another $k_3 \in \mathscr O(\{p\})$ we can show $\rho_{X\rightarrow\{q\}}$ is not injective, which is a contradiction since it is a morphism from a field.

Given any two-point discrete scheme (any not discrete scheme has only trivial open covers so is affine) , we can see $\mathscr O(\{p\})=\mathscr O_p$ for each $p$. So, $\mathscr O(\{p\})$ is local. Consider the map $\phi :\mathscr O(\{p\})\times \mathscr O(\{q\}) \rightarrow \mathscr O(X)$. Where $\phi(r,s)$ is the unique section of $\mathscr O(X)$ that restricts to $r$ and $s$ respectively on $\mathscr O(\{p\})$ and $\mathscr O(\{q\})$, (note this section exists and is unique by the sheaf property). This map is clearly a ring morphism and injective (and well defined by uniqueness of the section), it is clearly surjective as well as any global section $s$ restricts to $r_1 \in \mathscr O(\{p\})$ and $r_2\in \mathscr O(\{q\})$. By definition $\phi(r_1,r_2)=s$ so we are done. So any two-point scheme is affine. It is trivial to show any one-point scheme is affine. So the smallest non-affine scheme has three points.

This argument together with some induction shows $$\bigsqcup_{i=1}^n\operatorname{Spec} R_i\cong \operatorname{Spec} \prod_{i=1}^n R_i$$ which should not be that surprising. What is truly surprising is that this fails for any infinite cardinal as
$\bigsqcup_{i=1}^\infty\operatorname{Spec} R_i$ is not quasicompact but $\operatorname{Spec}\prod_{i=1}^n R_i$ is.