The entire family is captured (not only Louis XVI, MA , sister and children but his brothers and nephews) and executed in show trials. Louis-Philllipe of Orleans becomes the next heir (outside of the Spanish Bourbons) and he voted for the deaths of Louis, his son, Provence and Artois. The revolution is eventually crushed before Bonaparte's rise and there is a wholesale White Terror to crush all the regicides - including Louis-Phillipe. So no direct line Bourbons are alive and the Orleans have made themselves toxic in their entirety. We might have the Condes (if they survive) take the throne but outside of the Duc D'Enghien they have no male heirs in the next generation.
The victorious powers (Russia, Prussia, Austria, Britain) decide to put someone with St. Louis IX's blood on the throne - but NOT the Spanish Bourbons (who are not smarter or more attractive candidates for anything that they were in OTL), not caring if this someone is directly in line - just that they are competent.
Or you could simply have the lone Bourbon survivor of the Revolution be Marie-Therese, Madame Royale (just like in OTL but without her uncles/cousins surviving) and she is put on the throne with the condition that her non-Bourbon husband (possibly a Habsburg cousin) reign along with her and the line of kings after that will cease to be Bourbons.