This is based on gunes's answer above.
We can vectorize all the matrices as follows:
$$
\mathrm{vec}(A^{[l]}) = \begin{bmatrix}
a_{11} \\
a_{21} \\
a_{31} \\
a_{12} \\
a_{22} \\
a_{32} \\
a_{13} \\
a_{23} \\
a_{33} \\
\end{bmatrix}; \qquad \mathrm{vec}(P^{[l]}) = \begin{bmatrix}
p_{11} \\
p_{21} \\
p_{12} \\
p_{22} \\
\end{bmatrix}\\
\qquad \frac{\mathrm{d}J}{\mathrm{d}\{\mathrm{vec}(P^{[l]})\}} = \begin{bmatrix}
\frac{\mathrm{d}J}{\mathrm{d}p_{11}} &
\frac{\mathrm{d}J}{\mathrm{d}p_{21}} &
\frac{\mathrm{d}J}{\mathrm{d}p_{12}} &
\frac{\mathrm{d}J}{\mathrm{d}p_{22}}
\end{bmatrix} \qquad\text{eq.1}
$$
then compute the gradient $\frac{\mathrm{d}J}{\mathrm{d}A^{[l]}}$, as follows:
Note: I'm using the numerator-layout, so, the derivatives are technically Jacobians.
$$
\frac{\mathrm{d}J}{\mathrm{d}\{\mathrm{vec}(A^{[l]})\}} = \frac{\mathrm{d}J}{\mathrm{d}\{\mathrm{vec}(P^{[l]})\}} \frac{\mathrm{d}\{\mathrm{vec}(P^{[l]})\}}{\mathrm{d}\{\mathrm{vec}(A^{[l]})\}} \qquad\text{eq.2}\\
$$
here,
$$
\begin{align}
\frac{\mathrm{d}\{\mathrm{vec}(P^{[l]})\}}{\mathrm{d}\{\mathrm{vec}(A^{[l]})\}} & = \begin{bmatrix}
\frac{\partial}{\partial a_{11}} & \frac{\partial}{\partial a_{21}} & \frac{\partial}{\partial a_{31}} & \frac{\partial}{\partial a_{12}} & \frac{\partial}{\partial a_{22}} & \frac{\partial}{\partial a_{32}} & \frac{\partial}{\partial a_{13}} & \frac{\partial}{\partial a_{23}} & \frac{\partial}{\partial a_{33}}
\end{bmatrix} \otimes \begin{bmatrix}
p_{11} \\
p_{21} \\
p_{12} \\
p_{22} \\
\end{bmatrix} \\
& =
\begin{bmatrix}
\frac{\partial p_{11}}{\partial a_{11}} & \frac{\partial p_{11}}{\partial a_{21}} & \frac{\partial p_{11}}{\partial a_{31}} & \frac{\partial p_{11}}{\partial a_{12}} & \frac{\partial p_{11}}{\partial a_{22}} & \frac{\partial p_{11}}{\partial a_{32}} & \frac{\partial p_{11}}{\partial a_{13}} & \frac{\partial p_{11}}{\partial a_{23}} & \frac{\partial p_{11}}{\partial a_{33}} \\
\frac{\partial p_{21}}{\partial a_{11}} & \frac{\partial p_{21}}{\partial a_{21}} & \frac{\partial p_{21}}{\partial a_{31}} & \frac{\partial p_{21}}{\partial a_{12}} & \frac{\partial p_{21}}{\partial a_{22}} & \frac{\partial p_{21}}{\partial a_{32}} & \frac{\partial p_{21}}{\partial a_{13}} & \frac{\partial p_{21}}{\partial a_{23}} & \frac{\partial p_{21}}{\partial a_{33}} \\
\frac{\partial p_{12}}{\partial a_{11}} & \frac{\partial p_{12}}{\partial a_{21}} & \frac{\partial p_{12}}{\partial a_{31}} & \frac{\partial p_{12}}{\partial a_{12}} & \frac{\partial p_{12}}{\partial a_{22}} & \frac{\partial p_{12}}{\partial a_{32}} & \frac{\partial p_{12}}{\partial a_{13}} & \frac{\partial p_{12}}{\partial a_{23}} & \frac{\partial p_{12}}{\partial a_{33}} \\
\frac{\partial p_{22}}{\partial a_{11}} & \frac{\partial p_{22}}{\partial a_{21}} & \frac{\partial p_{22}}{\partial a_{31}} & \frac{\partial p_{22}}{\partial a_{12}} & \frac{\partial p_{22}}{\partial a_{22}} & \frac{\partial p_{22}}{\partial a_{32}} & \frac{\partial p_{22}}{\partial a_{13}} & \frac{\partial p_{22}}{\partial a_{23}} & \frac{\partial p_{22}}{\partial a_{33}} \\
\end{bmatrix} \\
& = \begin{bmatrix}
\frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{4} & \frac{1}{4} & 0 & 0 & 0 & 0 \\
0 & \frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{4} & \frac{1}{4} & 0 & 0 & 0 \\
0 & 0 & 0 & \frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{4} & \frac{1}{4} & 0 \\
0 & 0 & 0 & 0 & \frac{1}{4} & \frac{1}{4} & 0 & \frac{1}{4} & \frac{1}{4} \\
\end{bmatrix} \qquad\text{eq.3}
\end{align}
$$
from eq.1, eq.2, and eq.3, we have
$$
\begin{align}
\frac{\mathrm{d}J}{\mathrm{d}\{\mathrm{vec}(A^{[l]})\}} & = \begin{bmatrix}
\frac{\partial J}{\partial a_{11}} & \frac{\partial J}{\partial a_{21}} & \frac{\partial J}{\partial a_{31}} & \frac{\partial J}{\partial a_{12}} & \frac{\partial J}{\partial a_{22}} & \frac{\partial J}{\partial a_{32}} & \frac{\partial J}{\partial a_{13}} & \frac{\partial J}{\partial a_{23}} & \frac{\partial J}{\partial a_{33}} \\
\end{bmatrix} \\
& = \begin{bmatrix}
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{11}} \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{21}}\biggr) \\
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{21}} \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{12}}\biggr) \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{\mathrm{d}J}{\mathrm{d}p_{21}} + \frac{\mathrm{d}J}{\mathrm{d}p_{12}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{21}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) \\
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{12}} \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{12}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) \\
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{22}} \\
\end{bmatrix}^\intercal
\end{align}
$$
And, reshaping the above matrix, we get
$$
\frac{\mathrm{d}J}{\mathrm{d}A^{[l]}} = \begin{bmatrix}
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{11}} &
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{21}}\biggr) &
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{21}} \\
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{12}}\biggr) &
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{11}} + \frac{\mathrm{d}J}{\mathrm{d}p_{21}} + \frac{\mathrm{d}J}{\mathrm{d}p_{12}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) &
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{21}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) \\
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{12}} &
\frac{1}{4}\biggl(\frac{\mathrm{d}J}{\mathrm{d}p_{12}} + \frac{\mathrm{d}J}{\mathrm{d}p_{22}}\biggr) &
\frac{1}{4}\frac{\mathrm{d}J}{\mathrm{d}p_{22}} \\
\end{bmatrix}
$$