Heat olive oil and butter in a large skillet over medium-low heat. Add sliced onions and cook over low heat for 30-45 minutes, stirring occasionally, until deep golden brown and very soft.
Stir in brown sugar and balsamic vinegar into caramelized onions. Cook for 2-3 minutes, stirring constantly, until sugar dissolves. Season with salt and pepper. Remove and set aside.
In the same skillet, heat olive oil over medium-high heat. Add sliced mushrooms and cook for 8-10 minutes, stirring occasionally, until browned and softened.
Add minced garlic and fresh thyme to mushrooms. Cook for 1 minute, stirring constantly. If using wine, pour into skillet and let reduce for 1-2 minutes. Season with salt and pepper. Remove and set aside.
Butter one side of each bread slice. Optional: spread Dijon mustard on unbuttered side. Place bread buttered-side-down in clean skillet over medium-low heat. Layer Swiss cheese on each slice, then add onions and mushrooms to two slices.
Cook for 3-5 minutes until cheese melts and bread turns golden brown. Cover skillet with lid to help cheese melt. Flip plain cheese slices onto loaded slices to create complete sandwiches. Cook 2-3 minutes more until both sides are golden.
Remove from heat, cut sandwiches in half, and serve immediately while hot and cheese is melted.
Notes
Don’t rush the caramelized onions. Low and slow cooking develops sweetness and depth of flavor.
Wipe mushrooms clean with damp paper towel instead of washing to prevent waterlogging.
Cover skillet with lid while cooking to help cheese melt faster and more evenly.
Gruyere, provolone, or sharp cheddar can substitute for Swiss cheese.