It appears like an important reason behind Bavaria leaving Napoleon in 1813 was ambitions to play an important role in post war Germany.
Probably.
The Congress of Vienna 1815 would anyway be the perfect POD for changing German unification. IOTL, Prussia grew INTO Germany, whereas Austria grew OUT of it. Looking at the map one can clearly see that a Germany without Prussia after 1815 seems nonsense, whereas a "small-german solution" seems geographically, and ethnically, reasonable. Thus to get a unified Germany without Prussia, I'd recommend a change in the treaty of Vienna 1815:
Prussia gets the whole of Saxony, but nothing in the Rhineland (or only very minor territories). Venice becomes independent again, so does Milan under some Austrian prince. On the other side, Austria keeps (parts?) of its Netherlands. The German parts of Tyrol is lost to Bavaria, the smaller austrian territories in South-West Germany are also lost. For these, Austria gets the former bishiopric of Liege and the Rhineland. Westphalia becomes independent.
Such a peace treaty in summary means that Prussia is a solely eastern German country, whereas Austria is a main power in south-east Germany AND West Germany. Thus Austria grows INTO Germany and Prussia grows out. Austrian chances for industrialization are increased due to Belgium and the Rhineland, Prussian chances are decreased. Economic unification of Germany is crucial for Austria, but much less so for Prussia. In effect, the roles of Prussia and Austria are changed ITTL "simply" by a singel POD in 1815.