Heat the oven to 400 degrees.
Place the cream, garlic and thyme into a small saucepan. Heat on low for 15 minutes.
Grease a 9×13 baking dish with the butter.
Place the butternut squash and onions into a large bowl. Remove the garlic and thyme from the cream mixture. Pour the cream over the vegetable mixture. Stir well to coat.
Take a few spoonfuls of the cream and place it on the bottom of the baking dish.
Remove the butternut squash and onions from the cream and lay in overlapping layers until the bottom of the dish is covered. Sprinkle with salt and then with a handful of gruyere and parmesan cheese. Continue this process until all the vegetables are used and 1/2 cup of gruyere remains.
Press down on the gratin to compress the layers then pour the remaining cream onto the gratin.
Top with the remaining 1/2 cup gruyere (or more if desired).
Combine the melted butter and bread crumbs. Evenly distribute over the top of the gratin.
Place in the oven and bake for 1 hour. Lightly cover the gratin with foil if the top is browning too quickly.
Serve warm.