Caramelizing the Onions: Heat a pan on low-medium heat and add a small amount of clarified butter. Add the sliced onions and season with a pinch of salt to help them release moisture. Cook slowly for 30-40 minutes, stirring occasionally, until golden brown. Avoid burning. Set aside.
Preparing the Potatoes: Slice the potatoes thinly using a mandoline or a sharp knife (about 2mm thick). Melt butter in a microwave for 20 seconds. Let it settle, then separate the clear butter from the milk solids (removal of solids is optional).
Layering the Dish: In an oven-safe dish or cast iron pan, spread a layer of caramelized onions at the bottom. Add a layer of potato slices, slightly overlapping. Drizzle clarified butter and spoon some beef stock over the potatoes. Season lightly with salt and black pepper. Repeat the layering process, alternating potato direction for structure. Finish with a top layer of potatoes and sprinkle fresh thyme leaves.
Cooking the Pommes Boulangère: Preheat oven to 120°C (250°F). Cover the dish with a parchment paper cartouche with a small hole in the center. Place a heatproof plate on top to press down the layers. Bake for 45 minutes, then remove the plate. Increase temperature to 130°C (265°F) and bake for another 25 minutes until caramelized. Remove the cartouche, add more clarified butter and stock, and bake for another 10-15 minutes until golden brown. In the last 5 minutes, sprinkle fresh thyme leaves.
Serving: Ensure the potatoes are tender, the top is caramelized, and the edges are crispy. Serve hot, making sure to scoop from the bottom to get the caramelized onions with each portion.