It's hard to imagine a scenario where Joe Biden does not win his parties nomination, but will he be on the ballot in 2024? I don't think so. I think the Dems figured this out 18 months ago when Democrats made South Carolina their 1st primary state. At this time they added a provision to deal with the possibility that Joe Biden would not be fit for office.
How would this work?
Most likely just before or even during the Democrat convention, President Biden will step down for personal reasons. He may say it's for the well being of the nation or for obvious health issues. At this time the "party" will select someone to replace Joe on the ballot. This will not be a "democratic" process. Democrat Super Delegates will pick their nominee and our Democracy will die a little bit more behind closed doors.
Gavin Newsom?
Michelle Obama?
Susan Rice?
Someone yet to be identified?
Soon after declaring his candidacy Robert F. Kennedy Jr. learned that the pathway to the democratic nomination was for all practical matters impossible. If he won every "winner take all state" and 50% of the state delegates allotted by percentage he still wouldn't have enough delegates to overcome the Super Delegate hegemony. Obviously, democracy in the Democratic party can't be trusted to the voting public.
So again, it's pretty clear President Biden will "win" his parties nomination but not be on the ballot in November. I believe President Biden will step down and his replacement will be chosen by Democrat Super Delegates. The narrative that this is democracy in action will be celebrated but you and I will know the truth. This is yet another manifestation of the permanent, mostly unelected, ruling class of United States.