The switcheroo can happen after the nominating convention.
So long as there is time to change the ballots, I suppose that is true. There would have to be some provision in the DNC bylaws about what happens if the candidate is no longer available after the convention has already occurred. I don't know what those bylaws say.