
Place the chicken thighs, drumsticks, pearl onions, red wine, thyme, and bay leaf in a large glass or ceramic bowl. Cover and marinate in the refrigerator for at least 12 hours and up to 24 hours.
Drain the marinade through a sieve set over a bowl. Reserve the wine and herbs. Separate the chicken from the onions, then pat the chicken very dry with paper towels.
Pour the reserved wine into a saucepan and bring to a boil over medium-high heat. Simmer until reduced by about half, skimming off any foam, then set aside.
Preheat the oven to 180°C / 350°F (160°C fan). Season the chicken all over with the salt and black pepper.
Heat the vegetable oil in a large heavy oven-safe pot over medium-high heat. Brown the chicken thighs skin-side down for 2 to 3 minutes until deeply golden, turn, and cook 1 minute more. Brown the drumsticks on several sides for about 5 minutes total. Transfer the chicken to a tray.
If the pot has any burnt bits, remove them. Add the bacon and cook for about 3 minutes until lightly crisp. Transfer to the tray with the chicken.
Add the mushrooms to the pot and saute for about 5 minutes until golden. Remove to a bowl. Add the marinated onions and cook for about 5 minutes until they develop browned patches.
Lower the heat to medium. Add the butter, then stir in the garlic and cook for 1 minute. Add the tomato paste and cook for 2 minutes. Sprinkle in the flour and cook, stirring constantly, for 2 minutes to remove the raw flour taste.
Slowly pour in the beef stock while stirring to keep the sauce smooth. Add the reduced wine and stir until the flour is fully dissolved and the sauce is mostly lump-free.
Return the chicken, bacon, mushrooms, reserved thyme, and bay leaf to the pot. Bring to a gentle simmer, cover, and transfer to the oven. Braise for 45 minutes, or until the chicken is tender and the sauce is rich.
Remove from the oven and taste the sauce. Adjust the seasoning if needed. For the best flavor, cool and refrigerate overnight, then reheat gently before serving.
Serve the coq au vin with mashed potatoes and finish with chopped parsley.