Preheat your oven to 200°C (400°F). Lightly butter your baking dish to prevent sticking and set aside.
Using a mandoline or sharp knife, thinly slice potatoes and zucchini to about 3mm thickness, keeping slices uniform for even cooking.
In a small saucepan, gently warm the heavy cream until it just starts to simmer — this helps it pour smoothly and meld with the cheese flavors.
Mix the grated cheddar and Gruyère cheese together in a bowl with a pinch of salt, pepper, and thyme if using — set aside.
Layer a few slices of potato at the bottom of the dish, overlapping slightly for a tight, even layer.
Follow with a layer of zucchini slices, then sprinkle a portion of the cheese mixture over the top for added flavor.
Repeat these layers until all vegetables are used, ending with a generous sprinkle of the cheese mixture on top.
Pour the warm cream evenly over the layered vegetables, ensuring all layers are slightly soaked—this helps them cook tender and absorb flavors.
Cover the dish tightly with aluminum foil and bake for about 30 minutes, or until the vegetables are tender when pierced with a fork.
Remove the foil and sprinkle the toasted breadcrumbs evenly over the top, then increase oven temperature to 220°C (430°F).
Bake uncovered for an additional 10-15 minutes, until the crust is deeply golden and bubbling with cheesy goodness.
Let the gratin rest outside the oven for about 5 minutes—this helps the layers set for easier slicing. Serve warm, garnished with fresh herbs if desired.