The reversal of the slope to bring the exit to near zero degrees causes compression shock waves. A properly designed nozzle will have these two sets of shock waves coincide and cancel each other out.
By reversing the slope to bring the exit close to zero degrees, compression shock waves are generated. A well-designed nozzle should have these two sets of shock waves overlap and neutralize each other.