No state will deny a Democratic nominee a position on the ballot if they are chosen by their upcoming convention.
It just will not happen in the real world.
There is no Democratic nominee right now. There is nobody to “replace”.
It’s not automatic. There are filing deadlines. There are ballot deadlines.
The DNC has been filing multiple lawsuits to stop one of their own party members, RFK, from being able to be on the ballot in many states. Some of their arguments for preventing his ballot access will apply to them.
It is possible that they switch their nominee and get the new one on the ballots in all 50 states, but it will be an uphill battle and is not as certain or simple as you imagine.
You have to remember that this is one of many difficult calculations they must make in deciding to switch candidates so late. Even if Biden is replaced, where does the new candidate get campaign money? How will the switch be perceived by the public? How can they do this without evoking a civil war within their party? How can they justify calling for his replacement as a candidate but not his replacement as the current president? How will they make everyone happy who feels they did not have a say at all in the selection of the nominee? What if merely 5% sit this election out in protest?