Heat an overproof, wide saucepan over a medium-high heat and when hot, add the oil, ½ of the butter, onions. Turn down the heat, cover with a lid or a cartouche and cook very slowly for 30 minutes over a low heat until the onions are completely softened and sweet. Turn up the heat and cook until the onions are golden-brown, remembering to stir occasionally so nothing catches on the bottom. Remove the pan from the heat and set aside.
In a separate pan, add the remaining ½ of the butter and the garlic and cook for a minute, then add the white wine and brandy and cook until the liquid has reduced by half. Add back ½ of the caramelised onions to the pan and stir, the other half will be used for garnish.
Pre-heat the oven to 200 C / 180 C fan.
Stir the flour into the pot and cook out for 2 minutes. Add the beef stock, slowly mixing well between each addition and then add the milk, until you have a lump-free sauce. Add the cooked macaroni, and the cheeses and stir through to melt the cheese and coat the pasta in sauce.
Spread a little mustard over the toasted baguette slices and place them on top of the macaroni then divide the reserved onions between the toasts and sprinkle the the remaining cheeses over everything, finishing with a good grinding of black pepper.
Place into the oven for about 15 minutes until everything is golden and bubbling.
Serve straight away sprinkled with thyme and with a green salad on the side.