In a Dutch oven, cook sliced onions in olive oil over medium heat for 15-20 mins until rich brown and caramelized. Stir constantly.
Reduce heat, add flour, and cook for 1-2 mins to remove raw taste.
Stir in wine, scraping the pan's bottom to remove browned bits. Add bay leaves, garlic, and thyme. Stir well.
Pour in beef stock, bring to a boil. Simmer uncovered for 10-15 mins. Season with salt and pepper. Remove bay leaves.
Preheat oven to 400℉ (205℃). In a baking dish, combine rice and 2½ cups of onion soup. Top with cubed butter. Cover with foil and bake for 30 mins.
Remove foil, fluff rice, and bake for another 30 mins.