Preheat the oven to 375°F (190°C). Butter a 9x13-inch baking dish.
Combine the cream, milk, garlic, and thyme in a saucepan. Warm gently over low heat for 5 minutes; don't let it boil.
Layer the potato slices in the baking dish, seasoning lightly as you go. Pour the warm cream mixture over the top, then scatter the Gruyère over everything.
Cover tightly with foil and bake for 40 minutes.
While the gratin bakes, season the trout fillets with salt and pepper and wrap each one tightly in 2 slices of bacon.
Remove the foil from the gratin. Nestle the bacon-wrapped trout fillets on top and return the dish to the oven, uncovered, for 15 to 18 minutes, until the bacon is crisp and the trout flakes easily.
Let it rest for 5 minutes. Scatter fresh dill or parsley over the top and serve with lemon wedges.