I'm going to elaborate a bit more on oezguensi's answer and see if we can resolve the problems with the dimensions which seem a bit off.
In the post you had 2 samples with 3 outputs (classes). In that case, $\frac{\partial L}{\partial Z}$ should have dimensions (3,2): https://en.wikipedia.org/wiki/Matrix_calculus#Scalar-by-matrix .
On the other hand $\mathbf{b}$ should be a (2,1) matrix of bias vectors, since you broadcast the bias twice, once per sample. Each one of these bias vectors has 3 components corresponding to the biases of each linear combination.
Let's type it out. Assume each data point has $D = 3$ features:
So we have:
$S = 2$ samples (batch size).
$D = 3$ features.
$M = 3$ classes (outputs).
We have: $X_{S\times D} =
\begin{bmatrix}
x_{11} & x_{12} & x_{13} & x_{14}\\
x_{21} & x_{22} & x_{23} & x_{24}\\
\end{bmatrix}$
and: $W_{D\times M} = \begin{bmatrix}
w_{11} & w_{12} & w_{13} \\
w_{21} & w_{22} & w_{23} \\
w_{31} & w_{32} & w_{33} \\
w_{41} & w_{42} & w_{43} \\
\end{bmatrix}$
Then we have:
$Z_{S\times M} = W \times X =
\begin{bmatrix}
z_{11} & z_{12} & z_{13} \\
z_{21} & z_{22} & z_{23} \\
\end{bmatrix}$
For each row of the $Z$ matrix we have a bias vector $\overrightarrow{b}_{M \times 1} = (b_1, b_2, b_3)$ when we broadcast we get the bias matrix $\mathbf{b} = \begin{bmatrix}
\overrightarrow{b} \\
\overrightarrow{b} \\
\end{bmatrix}$
Let's write the derivatives (using the Wikipedia formula above):
$(\partial{L}/\partial{Z})_{M \times S} = \begin{bmatrix}
\partial{L}/\partial{z_{11}} & \partial{L}/\partial{z_{21}} \\
\partial{L}/\partial{z_{12}} & \partial{L}/\partial{z_{22}} \\
\partial{L}/\partial{z_{13}} & \partial{L}/\partial{z_{23}} \\
\end{bmatrix}$
The bias:
$(\partial{Z}/\partial\overrightarrow{b})_{S \times 1} = \begin{bmatrix}
1 \\
1 \\
\end{bmatrix}$
The derivative of the upstream with respect to the bias vector:
$$\frac{\partial L}{\partial \overrightarrow{b}} = \frac{\partial L}{\partial Z}\frac{\partial Z}{\partial \overrightarrow{b}}$$
Has shape $M\times 1$ and is the sum along the columns of the $(\partial{L}/\partial{Z})_{M \times S}$ matrix.
Each entry of this matrix gives you the downstream gradient of the entries of $\overrightarrow{b}$.
But it's important to note that it is common to give the upstream derivative matrix as its transpose, with shape $S \times M$, that is: batch size as rows and classes as columns. In this case, you sum along the rows of the transpose.
So just keep an eye on the shape of the upstream gradient to find out which direction to sum.