Let $R$ be $k[x,z_1,,z_2,\dots,z_d]_{\langle x,z_1,z_2,\dots,z_d\rangle}/\langle x^2 \rangle$. This is a local Noetherian ring of dimension $d$ that is a Cohen-Macaulay ring, even a local complete intersection ring. Let $M$ be $R/\langle x \rangle$. The sequence $(z_1,z_2,\dots,z_d)$ is an $M$-regular sequence. Thus $M$ has depth $d$, i.e., $M$ is a (maximal) Cohen-Macaulay module.

The unique associated prime of $R$ is $\mathfrak{p}=\langle x \rangle$. Thus, this also equals the set of all nonzero divisors. So $S^{-1}R$ equals the local ring $R_{\mathfrak{p}}$. The local ring $R_\mathfrak{p}$ is $K[x]/\langle x^2 \rangle$, where $K$ equals $k(z_1,\dots,z_d)$. The $R_{\mathfrak{p}}$-module $M_{\mathfrak{p}}$ is $R_{\mathfrak{p}}/\langle x \rangle$. This is not a free $R_{\mathfrak{p}}$-module.