If you are using a mosfet as the switch, and turn it off letting Vgs fall from 12V to 0V, then the source terminal is pulled to negative -12V by the gate-source capacitance. Since your oscilloscope has a range of 2V in the blue trace, and the capacitance pulls the voltage below that range, it appears flat for so long: in reality, it's below -2V. Then leakage through the mosfet/schottky recharges the source terminal to 0 volts. The diode has nothing to do with the whole proccess, except working as a open switch.