So is angular momentum preserved here or not? The only true way to answer this question is to take the everything considered to be within the isolated system and calculate all the torques on both magnets. Let's do this!
Magnet #1 with moment $\vec{m} = m\hat{z}$ is at the origin. Magnet #2 with moment $\vec{m}\,' = m'\hat{z}$ is at position $(a, b, c)$. A magnetic dipole in a magnetic field is influenced in two ways:
- there is a net translational motion due to the inhomogeneity in the magnetic field,
- there is a net rotational motion about an axis through the center of the dipole due to misalignment.
There are four torques (with respect to origin) to consider and then sum:
- Torque on magnet #2 due to translational motion.
- Torque on magnet #2 due to alignment.
- Torque on magnet #1 due to translational motion.
- Torque on magnet #1 due to alignment.
Part 1.
\begin{align*}
\vec{\tau}_{1} = \vec{r}_{\text{#2}}\times\vec{F}_{\text{on #2}} = \frac{mm'\mu_{0}}{4\pi}\left( \frac{6bc}{r^{5}}, -\frac{6ac}{r^{5}}, 0 \right).
\end{align*}
Part 2.
\begin{align*}
\vec{\tau}_{\text{dipole}} = \vec{m}\,'\times\vec{B}_{\text{due to #1}} = (-m'B_{y}, m'B_{x}, 0) = \frac{3mm'\mu_{0}}{4\pi}\left( -\frac{bc}{r^{5}}, \frac{ac}{r^{5}}, 0 \right).
\end{align*}
Now this is the torque about the center of the dipole. However, because the net magnetic charge on the dipole is zero, this torque ends up being independent of the reference point (c.f Why does the dipole moment depend on the distance?). Thus, the torque on magnet #2 due to alignment about the origin of our coordinate system is
\begin{align}
\vec{\tau}_{2} = \vec{\tau}_{\text{dipole}} = \frac{3mm'\mu_{0}}{4\pi}\left( -\frac{bc}{r^{5}}, \frac{ac}{r^{5}}, 0 \right).
\end{align}
Part 3.
\begin{align}
\vec{\tau}_{3} = \vec{r}_{\text{#1}}\times\vec{B}_{\text{due to #2}} = 0
\end{align}
because $\vec{r}_{\text{#1}} = 0$.
Part 4. We may have to do the full calculation to find $\tau_{4}$, but because both magnets are vertically aligned, we don't have to do much. The only thing that matters for expression for $\vec{B}_{\text{due to #A}}$ is the position relative to the source magnet and the dipole moment. In this case, we switch the vector $(a, b, c)\leftrightarrow (-a, -b, -c)$ and we switch $m\leftrightarrow m'$. Then
\begin{align*}
\vec{\tau}_{4} = \vec{m}\times\vec{B}_{\text{due to #2}} = (-mB_{y}, mB_{x}, 0) = \frac{3mm'\mu_{0}}{4\pi}\left( -\frac{bc}{r^{5}}, \frac{ac}{r^{5}}, 0 \right).
\end{align*}
Putting it all together. Finally, by summing up all the torques, we get
$$ \vec{\tau}_{1} + \vec{\tau}_{2} + \vec{\tau}_{3} + \vec{\tau}_{4} = 0 = \frac{d\vec{L}}{dt}\Big|_{t=0}. $$
As a result, the net torque is zero and the angular momentum conversation is not violated, at least at the instant $t=0$.
If we conceptualize every dipole as the limit of two monopoles converging together (which works mathematically although it's not physically true for magnetic dipoles since electrons, muons, etc. are not composed of magnetic monopoles), then by the fact that all monopole forces are central forces (in static and quasi-static regimes), it must be the case that all dipole interactions preserve angular momentum (in static and quasi-static regimes). See this question for a more conceptual take: Apparent violation of the law of conservation of angular momentum in the torques experienced by two interacting electric dipoles
Lastly, keep in mind all this applies only in the regime of electrostatics and magnetostatics. If the fields are changing in time, they become dynamical entities that must be considered as part of the system itself (because they can carry angular momentum). However, this is not what my OP is about, so that fact is irrelevant.