We have the spec functor $\text{CRng}^\text{op} \rightarrow \text{Aff}$.$\DeclareMathOperator{\Spec}{Spec}\DeclareMathOperator{\Hom}{Hom}$ Then $$\Hom _{\text{Aff}}(\Spec(\lim A_i), \Spec B) = \Hom_{\text{CRng}} (B, \lim A_i) $$ $$ = \lim \Hom_{\text{CRng}} (B,A_i) = \lim\Hom_{\text{Aff}}(\Spec A_i, \Spec B) $$ $$ = \Hom_{\text{Aff}}(\text{colim} \Spec(A_i), \Spec B) $$
This means $\Spec(\lim A_i)$ and $\text{colim} \Spec(A_i)$ both represent the same object.
But this clearly does not make sense when the colimit is infinite. What went wrong?
The equality $\operatorname{Spec}(\prod A_i) = \bigsqcup\operatorname{Spec}(A_i)$ is always false in the category of schemes if the set of indices $i$ is infinite and all the $A_i$ are $\neq 0$.
Indeed $\operatorname{Spec}(\prod A_i)$ is quasi-compact (like any $\operatorname{Spec})$, whereas $\bigsqcup\operatorname{Spec}(A_i)$ is never quasi-compact.
NB As quite judiciously commented by @Zhen Lin, the coproduct of affine schemes is different in the category of schemes from the coproduct in the category of affine schemes (which I have never seen used in algebraic geometry).