Preheat an oven. Trim the ends off the butternut squash, then peel until you see the orange flesh. Using a sharp knife or a mandoline, cut the squash into thick rounds. I find it’s helpful to separate the neck of the squash from the body. Cut the round body in half, then cut into thin slices.
Heat butter in a large cast-iron skillet over medium heat. When hot, add sliced shallots, then season lightly with about kosher salt. Cook, stirring occasionally, then add sliced squash, garlic cloves, and chopped thyme leaves. Raise the heat to medium-high. Season and cook.
Pour heavy cream on top of the squash, then use a spatula to help press it down to submerge fully. In a small bowl, mix together shredded Gruyère and breadcrumbs. Sprinkle all over the top of the squash.
Transfer to the oven, then cook until the top is browned, the cheese has melted, and the squash is tender. Cool slightly, then serve with a sprinkle of flaky sea salt and fresh thyme leaves.