Place the onions in a microwave-safe bowl. Cover with damp paper towel. Microwave for 3 minutes on High/100% power. Transfer to a frying pan with olive oil. Add the sugar. Cook, stirring over medium heat for 10 minutes until caramelized.
Arrange the potatoes on a large microwave-safe plate in a single layer. Cover with damp paper towel, microwave for 10 minutes on High/100% power or until potatoes are just tender when tested with a skewer.
Meanwhile, melt butter in a saucepan over medium-high heat. Cook, stirring, for 30 seconds. Add the flour. Cook, stirring, for 1 minute until bubbling. Combine milk and stock in a jug, gradually add to butter/flour, stirring until smooth. Cook, stirring, for 5 minutes or until sauce comes to the boil. Whisk in mustard, season. This is your sauce.
Preheat oven 200°C. Transfer potatoes to a lightly greased 10-cup capacity ovenproof dish. Spoon the onions over the potatoes. Pour over the hot sauce. Season well.
Press a sheet baking paper onto the surface then cover tightly with foil. Place onto a tray and bake 20 minutes or until potatoes are completely tender when tested with a skewer.
Increase oven to 220°C. Remove the paper and foil, scatter over the cheese. Bake a further 5-8 minutes or until cheese is golden and edges bubbling. Sprinkle with thyme. Serve.