In this post https://mathoverflow.net/questions/426917/an-example-of-a-local-integral-domain-with-special-spectrum a local integral domain $(D, m)$ is constructed such that the spectrum looks like
$$ \mathrm{Spec}(D)=\{(0), m\}\cup \{ P_i\}_i$$
with
$$ \bigcup_i P_i \neq m$$
and for $i\neq j$ we have
$$P_i\not\subset P_j, P_j\not\subset P_i.$$
Furthermore, $\{ P_i\}_i$ contains infinitely many primes (two would be enough for us).
Now pick an element $x\in m\setminus \bigcup_i P_i$ and define $S=\{ 1, x, x^2, \dots\}$ to be the multiplicative set generated by $x$. Then $S^{-1} P_i$ are all maximal in $A=S^{-1} D$ (they are prime as they don't intersect $S$ by construction and they are maximal as the map on the spectrum is inclusion-preserving and $S^{-1} m=A$ is not prime). In particular, $A=S^{-1} D$ is no longer local.
Easier version: Pick $R=\mathbb{C}[x,y]_{(x,y)}$ (i.e. $\mathbb{C}[x,y]$ localized at the multiplicative set $\mathbb{C}[x,y]\setminus (x,y)$). Then $R$ is a local ring and $$P_1:=(x)_{(x,y)}, P_2:=(y)_{(x,y)}$$ are two distinct prime ideals in $R$. Pick $$S=R\setminus (P_1\cup P_2)$$ as our multiplicative set. The idea is that we want to force $S^{-1}P_1, S^{-1}P_2$ to be maximal ideals in the localization. One way of doing so is to make everything outside $P_1, P_2$ invertible (and so kill those larger prime ideals).
Furthermore, we have using the strategy in Localizing a localization at a prime ideal
$$ S^{-1} R \cong T^{-1} \mathbb{C}[x,y] $$
with $T=\mathbb{C}[x,y]\setminus ((x)\cup (y))$. Now, the prime ideals in $T^{-1} \mathbb{C}[x,y] $ are in correspondence with the prime ideals in $\mathbb{C}[x,y]$ not intersecting $T$ (see How to show that there is a bijective correspondence between two sets of prime ideals), i.e. which are contained in $(x)\cup (y)$. Hence, the maximal ideals in $T^{-1} \mathbb{C}[x,y] $ are $T^{-1} (x), T^{-1}(y)$ and therefore it is not a local ring.