We study a superconductor-normal-state-superconductor Josephson junction along the edge of a quantum spin Hall insulator with a superconducting pi phase across the junction. We solve self-consistently for the superconducting order parameter and find both real junctions, where the order parameter is fully real throughout the system, and junctions where the order parameter has a complex phase winding. Real junctions host two Majorana zero modes (MZMs), while phase-winding junctions have no subgap states close to zero energy. At zero temperature we find that the phase-winding solution always has the lowest free energy, which we establish as being due to a strong proximity effect into the N region. With increasing temperature this proximity effect is dramatically decreased and we find a phase transition into a real junction with two MZMs.