Here is an example of $G$ for which $k[\mathfrak{g}]$ is not a free $A$-module, where $A=k[\mathfrak{g}]^G$. Let $G=\mathrm{PGL}_p$ where $p\ge 5$, a simple algebraic group of adjoint type with $\mathfrak{g}=\mathfrak{pgl}_p$. The Chevalley Restriction Theorem holds for $G$ as follows, e.g., from the Springer-Steinberg paper (see Ch. II, 3.17). Then we have that $A\cong k[\mathfrak{t}]^W$ where $\mathfrak{t}$ is the image of the diagonal matrices in $\mathfrak g$. Of course, $W\cong\mathfrak{S}_p$ and $\mathfrak{t}$ is the quotient of the natural $\mathfrak{S}_p$-module $V$ with basis $\{e_1,\ldots, e_p\}$, permuted by $\mathfrak{S}_p$, by its trivial submodule $k(e_1+\cdots+e_p)$. By a result of Gregor Kemper, for $p\ge 5$ the ring $S(V^*)^{\mathfrak{S}_p}\cong k[\mathfrak{t}]^W$ is not Cohen-Macaulay (see Corollary 2.8 and Example 2.9 in Kemper's paper published in J. Algebra, Vol. 215 (1999), 33--351). In particular, $k[\mathfrak{g}]^W$ is not a polynomial algebra, which resolves in the negative Problem 3.18 in the Springer-Steinberg paper. Let $x\in\mathfrak{gl}_p$ and write $I$ for the identity matrix of order $p$. Let $f_1(x),\ldots, f_{p-1}(x)$ be the coefficients of $t^{p-1}, \ldots, t$ in $\chi_x(t):=|tI-x|$. Since for all $\mu\in k$ we have that $$|tI-(x+\mu I)|^p=|(t-\mu)^p-x^p|,$$ it is easy to see that $f_i(x+\mu I)=f_i(x)$ for all $i$. So the $f_i$'s can be regarded as elements of $A$. Since $A\cong k[\mathfrak{t}]^W$ has Krull dimension $p-1$, the $f_i$'s form a homogeneous sytem of parameters for $A$. Since the nilpotent cone of $\mathfrak{g}$ is irreducible of codimension $p-1$ and coincides with the zero locus of the $f_i$'s it follows that $k[\mathfrak{g}]$ is a free module over $A_0:= k[f_1,\ldots, f_{p-1}]$. If $k[\mathfrak{g}]$ is free over $A$ then $A$ is finitely generated and projective over $A_0$. But then $A$ is free over $A_0$ implying that $A$ is Cohen-Macaulay. This contradiction shows that Kostant's freeness theorem fails in our case.