Preheat your oven to 400 degrees F. Butter the inside of a 9x13 baking dish or 2-quart casserole dish. Set aside.
Cut the sweet potatoes and squash into 1-inch cubes. Add the veggies to a large mixing bowl.
Whisk together the heavy cream, milk, flour, garlic, thyme, salt, and pepper in a medium mixing bowl. Pour the cream mixture over the veggies and stir to coat.
Transfer the veggies and cream mixture to the prepared baking dish. Cover with foil.
Bake for 30 minutes. Carefully remove the foil from the dish. Then bake uncovered for another 30 minuntes until the veggies are tender.
Remove the baking dish from the oven and sprinkle the shredded cheese all over the top. Return the dish to the oven for another 5 minutes or until the cheese is melted and bubbling.
Remove from the oven and let sit for 5-10 minutes before serving warm.