Heat the oven to 320°F (160°C).
Rub the beef with 1 teaspoon of olive oil and season with salt and pepper. Heat a large ovenproof casserole dish on the stove top, and brown the beef all over for about 10 minutes.
Meanwhile, heat another 2 teaspoons of olive oil in a skillet and cook the carrots and celery for 10 minutes until lightly golden.
Remove the beef from the casserole dish, onto a plate. Pour in the beef broth and white wine vinegar, and return the beef to the casserole. Now add the carrots, celery and bay leaves. Cover the casserole with a lid and cook in the oven for 2 hours turning the beef halfway through cooking.
Heat the remaining tablespoon of olive oil in the same skillet and add in the onions, thyme and season with salt and pepper. Cover and bring to a gentle simmer, cooking for 20 minutes until the onions have softened. Remove the lid, turn up the heat, add the butter and coconut sugar, and let the onions caramelize to a dark golden brown, stirring often. Remove the thyme sprigs, then set aside.
When the beef has finished cooking, remove the beef and the carrots from the casserole dish and set aside. Reheat the onion pan, stir in the flour and cook for 1 minute. Whisk the onions into the beefy juices in the casserole, to make a thick onion gravy. Check for taste and season with salt and pepper if necessary. Add the beef and carrots back to the casserole and serve.