You can substitute skinless haddock or halibut for the cod.
Adjust oven rack to lower-middle position and heat oven to 425 degrees. Toss potatoes with melted butter, garlic, minced thyme, ½ teaspoon salt, and ¼ teaspoon pepper in bowl. Shingle potatoes into four 6 by 4-inch rectangular piles on rimmed baking sheet.
Roast until spotty brown and just tender, 30 to 35 minutes, rotating sheet halfway through roasting.
Pat cod dry with paper towels and season with salt and pepper. Lay 1 cod fillet, skinned side down, on top of each potato pile and top with butter pieces, thyme sprigs, and lemon slices. Bake until cod flakes apart when gently prodded with paring knife and registers 140 degrees, about 15 minutes.
Remove sheet from oven. Slide spatula underneath potatoes and cod and gently transfer to individual plates. Serve.
