Joe Biden declared his candidacy on April 25, 2023, while the debate was one year and two months later, on June 27, 2024. So even though the primary election had not yet been held, Joe Biden was the presumptive candidate for the Democrat Party.
Cancelling out over 14 million primary election votes is not the way legitimate elections are supposed to be conducted, and someone should file a lawsuit against the DNC. Nor should Donald Trump have to debate Kamala Harris. She is a usurper who is taking part in the destruction of the democratic process.
That being said, Trump will most likely debate her.