In a large bowl, combine gluten-free flour and salt. Add cold, diced butter and use a pastry cutter or your fingers to blend into the flour until the mixture resembles coarse crumbs. Gradually add ice water, 1 tablespoon at a time, mixing until the dough comes together. Form into a disk, wrap in plastic, and refrigerate for at least 1 hour.
In a large skillet, heat olive oil over medium heat. Add the onions with a pinch of salt, and cook slowly, stirring occasionally, until they are deep golden brown and caramelized, about 20-25 minutes. Remove from the skillet and set aside.
In the same skillet, add a bit more olive oil if needed, and sauté the mushrooms until they are soft and all the moisture has evaporated. Stir in the thyme, salt, and pepper. Set aside to cool.
Preheat the oven to 375°F. On a piece of parchment paper, roll out the chilled dough into a 12-inch circle. Transfer the parchment and dough onto a baking sheet.
Spread the caramelized onions and cooked mushrooms over the dough, leaving a 2-inch border. Crumble the goat cheese over the top. Fold the edges of the dough over the filling, pleating as needed. Brush the crust with beaten egg. Bake for 35-40 minutes, or until the crust is golden and the filling is bubbly. Let cool slightly before serving.