I just watched this video about the spark of the Onin War and in a part, the narrator says that "in a complicated string of events" Yoshimi Ashikaga, brother of the Shogun Yoshima and former Shogun's heir (before Yoshima named his newborn son the heir), a succession crisis that began the war, changed sides from Katsumoto's (that endorsed Yoshimi as the next Shogun) to Sozen (that endoresed the Shogun's son as the next Shogun). How did that happen and how did that not end the war (or at least heavily deplepted Katsumoto's support)?
The specific events are somewhat complicated, but the broad strokes are not. The key thing to understand here is that the Onin War was not a succession dispute within the shogunal house. At the time that the conflict broke out, Yoshimi was still formally Yoshimasa's heir.
But it soon became apparent to Yoshimi that that was likely to change. A prominent supporter of his was murdered on orders of the shogun and one of his major enemies (who had been forced to flee Kyoto in 1466 for plotting to have Yoshimi assassinated) was permitted to return to court. Katsumoto's support had become a bit lukewarm as well (his primary goal being to come out ahead of Yamana, not to see Yoshimi on the throne). Seeing the writing on the wall, Yoshimi defected to Yamana. It was only at this point that Yoshihisa was designated the new heir.
You might find this answer helpful.