The Hall–Paige conjecture, and synchronization for affine and diagonal groups