@Vistulian its an interesting idea and one that, while difficult, might not be impossible to reach. However, you would need a POD of 1813. First, a little backstory; during the Napoléonic wars King Maximilian I Josef of Bavaria was one of Napoléon's closest, and earliest, German allies. The King allied with Napoléon in August 1805, shortly before the Austerlitz campaign that saw the French become masters of Germany, gaining a royal Crown and the Tyrol for his troubles. The King remained a loyal ally of France for most of the period, even marrying his daughter to the Emperor's stepson Eugéne in 1806. This changed on the eve of the Battle of Liepzig, when the King, influenced by his son Kronprinz Ludwig and Marshal von Wrede, signed the Treaty of Ried with the allies, switching sides in exchange for guaranteeing his crown, sovereignty and borders. Now compare this defection to another of Napoléon's German allies, King Friedrich August I of Saxony. The Saxon king attempted to defect to the allies, but they failed to support him in time, leading him back into the arms of Napoléon. In the aftermath Saxony was occupied by the Russians and the King held captive. This led to the Saxon-Polish crisis, the attempt by Prussia, with Russian support to annex the entirety of Saxony, and in exchange Berlin would cede its Polish territories to the Tsar.
So the key here is to have Bavaria fail to defect for whatever reason and get treated as an enemy nation, likely occupied by Austria. The Austrians had the hope of annexing Bavaria throughout the 18th century, so I can easily see it suggested to Emperor Franz I. Then, once Prussia starts demanding Saxony, Metternich (not sure what he would support here) can make the offer; we'll let you have Saxony in exchange for letting us have Bavaria (or at least most of it). Maybe they throw in part of Galicia for Russia too. Prussia and Russia agree, the Saxon and Bavarian Kings are compensated with new states on the left bank of the Rhine and everyone leaves happy (well as long as your Austrian, Prussian or Russian). However, you would have to drop any chance of annexing (either entirely or parts of) Württemberg; Friedrich I was George III's son-in-law, and doing anything to his throne would insult British prestige, potentially triggering British intervention via a coalition to protect him. Not a smart move.
Now,
@Admiral Spaun , you say that this would trigger war with France, Britain and Austria, but I contest that. Like I pointed out above, if Russia is given the Polish territories the Tsar craved, then they give Prussia and Austria a free hand in Germany in exchange. As to Britain, harder to say. The British were all about a Balance of power, and both Prussia and Austria annexing middle powers would technically preserve that, as there's a plurality in that both states are strengthened and neither are really stronger than the other. Plus, in OTL Castlereagh (the British Foreign Secretary and chief negotiator at Vienna) was initially willing to let Prussia have Saxony, so if he was willing to sacrifice the Saxons, than whose to say he couldn't do the same to the Bavarians. Finally, France. The French are in NO position to do much of anything on their own, so at this point they're kinda nonentities, unless they can persaude the British to join them in opposition to the annexations, in which case we could see a war. But I think not.
Finally,
@Nivek , definitely NOT ASB. While the Congress was "officially" about restoring Europe's ancien régime, in actuality it was more about creating a new order for Europe and rewarding Napoléon's conquerors. Or are you unaware of the Saxon-Polish crisis? After all, if the Congress wanted to restore everything to 1789, then Prussia would have never tried to annex Saxony, nor would Austria get Venice or Sardinia-Piedmont the restored Republic of Genoa. So if it was possible for Prussia to potentially annex Saxony, then Austria annexing Bavaria would be in the cards.