Maxwell's equations in linear homogeneous matter: $$ \begin{eqnarray} \nabla\cdot\mathbf{E}&=&\frac{\rho}{\epsilon},\tag{1}\\ \nabla\times\mathbf{E}&=&-\frac{\partial\mathbf{B}}{\partial t},\tag{2}\\ \nabla\cdot\mathbf{B}&=&0,\tag{3}\\ \nabla\times\mathbf{B}&=&\mu\,\mathbf{J}+\frac{1}{c^2}\frac{\partial\mathbf{E}}{\partial t}.\tag{4} \end{eqnarray} $$ Equations $(2)$ and $(3)$ have solutions in terms of the scalar potential $\phi$ and vector potential $\mathbf{A}$: $$ \begin{eqnarray} \mathbf{E}&=&-\nabla\phi-\frac{\partial\mathbf{A}}{\partial t},\tag{5}\\ \mathbf{B}&=&\nabla\times\mathbf{A}.\tag{6} \end{eqnarray} $$ By substituting equations $(5)$ and $(6)$ into equations $(1)$ and $(4)$ using the Lorenz gauge $$\nabla\cdot\mathbf{A}+\frac{1}{c^2}\frac{\partial\phi}{\partial t}=0\tag{7}$$ and the vector identity $$\nabla\times(\nabla\times\mathbf{A})=\nabla(\nabla\cdot\mathbf{A})-\nabla^2\mathbf{A}\tag{8}$$ we obtain wave equations for $\phi$ and $\mathbf{A}$: $$ \begin{eqnarray} \nabla^2\phi-\frac{1}{c^2}\frac{\partial^2\phi}{\partial t^2}&=&-\frac{\rho}{\epsilon},\tag{9}\\ \nabla^2\mathbf{A}-\frac{1}{c^2}\frac{\partial^2\mathbf{A}}{\partial t^2}&=&-\mu\mathbf{J}.\tag{10} \end{eqnarray} $$ Imagine two linear isotropichomogeneous dielectrics meet at a smooth interface: region $1$ has permittivity $\epsilon_1$ and region $2$ has permittivity $\epsilon_2$.
By using a pill-box across the interface Gauss's law, equation $(1)$, implies the following condition for the component of the electric field normal to the interface: $$\epsilon_2\,\mathbf{E}_{2n}-\epsilon_1\,\mathbf{E}_{1n}=\rho_A\tag{11}$$ where $\rho_A$ is the surface density of free charges.
Substituting equation $(5)$ into equation $(11)$ gives $$\epsilon_2\left(-\nabla\phi-\frac{\partial\mathbf{A}}{\partial t}\right)_{2n}-\epsilon_1\left(-\nabla\phi-\frac{\partial\mathbf{A}}{\partial t}\right)_{1n}=\rho_A.\tag{12}$$
However the wave equation for the scalar potential $\phi$, equation $(9)$, also has a matching condition across the interface which can be derived using a pill-box. Noting that $\nabla^2\phi=\nabla\cdot\nabla\phi$ one can use the divergence theorem in the limit of zero pill-box height to obtain $$\epsilon_2(-\nabla\phi)_{2n}-\epsilon_1(-\nabla\phi)_{1n}=\rho_A.\tag{13}$$ The contradiction between equations $(12)$ and $(13)$ does not seem to be due to writing equations in terms of $\phi$ and $\mathbf{A}$ since $\mathbf{E}$ and $\mathbf{B}$ are gauge invariant.
Does this show that Maxwell's equations are inconsistent?