Melt the salted butter with 2 tablespoons of olive oil in a large skillet over medium heat. Add the chopped onions, pour in ¼ cup water, and cover the skillet. Cook for approximately 5 minutes, or until the onions begin to soften.
Remove the lid and lower the heat to medium-low. Continue cooking the onions for about 1 hour, stirring frequently to prevent scorching, until they become deeply browned, soft, and richly caramelized. Transfer them to a bowl and fold in 2 tablespoons of chopped fresh thyme.
Place the all-purpose flour, warm water, shredded Parmesan, 2 tablespoons of olive oil, sugar, instant yeast, and salt in a large mixing bowl. Stir thoroughly with a wooden spoon until no dry flour remains and a cohesive, sticky dough forms.
Lightly coat a clean large bowl and your hands with olive oil. Transfer the dough to the prepared bowl, cover it securely with plastic wrap, and leave it in a warm location for approximately 1 hour, or until it has doubled in volume.
While the dough rises, warm ¼ cup olive oil in a skillet and add the crushed garlic cloves. Cook gently for about 5 minutes, just until the garlic becomes fragrant and begins to brown. Remove and discard the cloves before they darken further, then allow the infused oil to cool.
Preheat the oven to 425°F (220°C). Pour half of the cooled garlic oil into an unlined 9 × 9-inch metal baking pan, spreading it across the base.
Once the dough has doubled, lightly oil your hands. Lift the upper edge of the dough, stretch it upward, and fold it back over the center. Repeat this stretching and folding action with the remaining three sides.
Place the folded dough seam-side down in the prepared pan. Cover the pan with plastic wrap and let the dough rise in a warm area for approximately 1 hour, until doubled, visibly airy, and nearly expanded to the edges of the pan.
Dimple, season, and bake. After the second rise, pour the remaining garlic-infused oil evenly over the bubbly dough. Press your fingertips vertically and firmly into the surface to form pronounced dimples. Scatter 1 to 2 tablespoons of fresh thyme over the top.
Bake for 12 to 18 minutes, until the focaccia is evenly golden brown and its internal temperature reaches at least 190°F (88°C).
Immediately after removing the bread from the oven, distribute the prepared caramelized onions across the surface. Place the pan on a wire rack and allow the focaccia to cool.
Once cooled sufficiently for slicing, garnish with flaky sea salt and additional fresh thyme, if desired. Cut into portions and serve.