It works if you scalarize. If you don’t scalarize it gives you an error saying that it cannot currently do array derivatives and tells you to scalarize. The comments you have here are consistent with that.
The easiest thing is probably just to Symbolics.scalarize(A)
.
We are of course going to work on adding matrix derivatives but until that feature exists this error will be there.