In a medium bowl, combine flour, salt, and thyme. Cut butter into small cubes. Then, using a pastry cutter or your fingers, mix the butter into the flour until it resembles coarse sand.
Add water and quickly bring dough together into a very rough ball. Tightly wrap dough in 2 sheets of plastic wrap and store in the fridge to rest for at least 1 hour.
While dough is resting, heat oven to 350°F. Cut butternut squash in half, scoop out seeds, and put face down on a baking tray. Roast in the oven until very soft (about 45 min).
While butternut squash is roasting, slice onions into thin half moons and add to a skillet with 1-2 tablespoons butter. Cook over a low heat, stirring occasionally until the onions are soft and caramelized.
After the dough has rested, roll out into a rectangle shape. Spread the softened butternut squash puree on the base of the crust. Then add the caramelized onions. Generously scatter grated Appenzeller cheese over the onions. Thinly slice the apples and layer on top.
Fold the crust edges over the apples and sprinkle with thyme. Whisk the egg and brush over the crust, and then pop the galette in the oven for 45-50 minutes or until golden brown.