Restore the HRE at the Congress of Vienna?
Historically most of the lesser german monarchs were in favor of the restoration of the HRE, as they felt threatened by the possibility of a resurging France as well as by Prussia.
I'm not sure about Prussia's stance in this case as it might politcally might have opposed it but was not yet contesting Austria over the case of forming a german nationstate.
It's mainly due to Russian and British interests that the German states were only organized in a loose federation. Britain: Containing French might by building buffer states, without giving anyone enough to pose a real threat to British ambitions. Russia: avoid a strong neighbour.
So in nucleus it would be:
Austria and the lesser minor german states (foremost Saxony, and the deposed Pince-Archbishops)
vs.
Russia
Prussia and the bigger minor german states (Bavaria and Württemberg foremost)
Britain, who rules Hannover in personal union and will not allow the newly formed Netherlands to be part of the HRE
It would not be fair to say that only the foreign powers are to blame, especially the monarchs of the former Rheinbund, allies of Napoleon, where not absolutely in favor of gaining a new liege. But mainly fearing to loose their titles or territories they got from the hands of Napoleon.
Faith should not be a major obstacle, as the German kings, dukes, princes and so forth, where way more obesessed with power (territory, titles, money, prestige) than with religious beliefs. I'm not aware to ever came across religious differences concerning the German states while reading about the congress.
What you need?
I guess a POD that is sometime before 1815 that either changes the political situation at the congress (changing Russia's opinion for example) or change the circumstances/presets under which the congress is held upon.
I for one would do the latter, change the way in which/how/by whom Napoleon is defeated and go on from there. The lesser Russia's and Britain's role in the affair the lesser they could interfere in the post-war order of Germany.
I for one are doing something similar in a TL, but it ends in a "Liberal Kaiserreich"-Wank. But just to give you an idea here it goes: The Austrians are really lucky in 1809 and not only win against Napoleon at Aspern but also in the following battle at Wagram and thus force Napoleon to retreat. Meanwhile morale is skyhigh in most of the german states (as it was in OTL after Aspern) and young German men are flocking to the Freikorps (kind of guerrilla troops) pestering the French and their vassals all over Germany. Incited by Austrian victories the Prussian king stops wavering and sides against Napoleon...
In the end you may end up with France defeated mainly by the German states and a conference on which the Russian and British delegations have little say.
A Sidenote: Pan-germanic flag
I hear this name for the very-first time. And I must say it does not only sound very strange but outright wrong. The name alone brings very unpleasant pictures to my brain.
The flag you are describing, gold-red-black from top to bottom, is nothing else but the flag that was used in the revolution of 1848 and is used today by the Federal Republic of Germany; in the nineteenth century it was not uncommon to read flag colors bottom to top.
I would prefer it to call it the liberal flag or something like this, pan-germanic sounds like they were going to invade Russia the next second. (sorry I couldn't resist)