Whenever you evaluate
, the expression should not contain derivatives, otherwise simplification by sympy will throw that error. But you can turn that off, so the following does what you want:
\partial{#}::PartialDerivative;
{t,x,y,z}::Coordinate;
{\mu, \nu}::Indices(values={t,x,y,z});
A^{\mu}::Depends(\partial{#});
dA:=\partial_{\mu}{ A^{\mu} };
evaluate(dA, simplify=False);
If you replace the last two lines with
dA:=\partial_{\mu}{ A^{\nu} };
evaluate(dA, simplify=False);
you get that 2x2 expression.