Preheat oven to 400°F (200°C) with a rack in the center. Peel the loose outer layers from each garlic head, leaving skins around cloves intact, and slice ¼ to ½ inch off the top so every clove is exposed.
Set each head cut side up on an 8-inch square of foil, drizzle about ¾ teaspoon olive oil over each, and crimp the foil tightly closed. Roast on a rimmed baking sheet for 45 minutes until cloves are completely soft and golden to deep amber.
Dice the onion into ¼-inch pieces (about 1½ cups), cube the peeled potatoes into ½-inch pieces, and keep the thyme sprigs whole. Measure the broth and have salt, pepper, and bay leaf ready.
Melt the butter in a Dutch oven over medium heat until foaming, add the onion and ½ teaspoon salt, and cook for 8 minutes, stirring often, until soft and translucent. Lower the heat if edges begin to brown.
Add the potatoes, broth, thyme, bay leaf, remaining ½ teaspoon salt, and black pepper. Bring to a boil, then reduce heat to medium-low, partially cover, and simmer for 20 to 25 minutes until the potatoes are tender.
Open the garlic packets carefully, cool the heads for 10 minutes, then squeeze the cloves out of their skins into a small bowl and mash with a fork into a rough paste.
Discard the thyme sprigs and bay leaf, stir the garlic paste into the pot, and warm for 1 minute. Puree with an immersion blender for 1 to 2 minutes until completely smooth, or blend in batches in a vented countertop blender.
Turn the heat to low and stir in the heavy cream and grated Parmesan, warming for about 3 minutes until the cheese melts without boiling. Stir in the lemon juice, taste, and add more salt if needed.
Ladle the soup into six warmed bowls and divide the croutons, shaved Parmesan, and chopped parsley evenly among them. Serve right away while hot and the croutons are crisp.