The adaptive-timestep ODE methods take larger timesteps in smooth regions. In the first case, the forcing function stays on, and the solver notices that the forcing function has changed and backtracks to better capture the change. In the second case, the forcing function returns to zero, and the timestep was large enough to step right past the active time of the forcing function. You can force the solver to stop at the discontinuous timesteps with tstops=[5.0, 6.0], decrease the maximum timestep, or change the forcing function with a callback.