While the bases are cooking, make the filling. Halve and thinly slice the onions and cut larger slices into smaller lengths.
Warm the butter in a medium-large skillet/frying pan over a medium heat then add the onions. Cook them, stirring now and then, so that the onions soften evenly and reduce down a little. Reduce the heat if they are browning too quickly - you want them to be completely soft and reduced before they brown. They should brown gradually over around 30 minutes. If needed, add a little more butter to help avoid burning.
As the onion is starting to brown, add the salt, sugar and thyme and continue to cook for a minute or two more until the onions are gently browned and very soft.
As the onions cook, whisk together the egg and cream, along with a pinch of salt and pepper.
Divide the onions between the tart base and spread out in a layer. Crumble the goat cheese evenly over the onions.
Pour the egg-cream mixture over the top of the cheese, making sure you pour all oven to help it be even. Gently press down the cheese to make sure it sits largely under the egg mixture. Add a little extra thyme and pepper on top, if you like.
Bake the tarts for around 20 - 25 minutes until gently browned on top and the egg mixture is set.