There is a type of union that is "self-aligning".
Instead of the union mating surfaces being flat and parallel, there is a ball and socket type joint with an o-ring that allows for some axial misalignment.
My previous owner had the pump (Superpump) and filter replaced and there is one of these...