Heat butter and olive oil in a wide skillet over medium-low heat. Add sliced onions with a small pinch of salt and cook 15–20 minutes, stirring occasionally, until softened.
Add remaining salt and continue cooking 20–30 minutes, stirring occasionally, until onions are deep golden brown, very soft, and reduced by about 70%. If onions begin to stick or brown too quickly, add 1–2 teaspoons of water and lower heat.
Add garlic and thyme and cook for 30–60 seconds until fragrant. Deglaze with wine or broth, scraping up any browned bits from the pan. Cook until the onions are fully reduced and no liquid remains.
Remove from heat and stir in black pepper. Onions should be deep brown, glossy, and jammy with no visible liquid.
Assemble sandwiches by layering a thin layer of cheese on one slice of bread, adding half of the onions, then topping with remaining cheese and the second slice of bread. Repeat for the second sandwich.
Butter the outside of each sandwich. Cook over medium-low heat for 4–5 minutes per side, flipping once, until bread is golden brown and cheese is fully melted. Cover briefly if needed to help melt the cheese.
Let sandwiches rest for 1–2 minutes before slicing and serving.