Preheat oven to 400°. Thinly slice 2 lbs. fennel bulbs (reserving ender fronds for later) and 1 onion. Place in a large bowl along with 1 cup heavy cream, 4 Tbsp unsalted butter cut into small pieces, and 1 Tbsp thyme leaves. Season with a big pinch of Kosher salt and black pepper.
Transfer to a 9"x9" baking dish and bake until fennel is crisp-tender and liquid is reduced by about half, 30-35 minutes.
While fennel bakes, mix 1½ cups breadcrumbs, 1 cup walnuts or pecans, coarsely chopped, and 2 Tbsp olive oil in a large bowl. Season with a pinch of Kosher salt and some black pepper. Mix in 1 oz. grated Parmesan and 1 Tbsp thyme leaves.
When fennel is tender, scatter breadcrumbs evenly over the gratin and bake until crispy and deep golden brown, about 12-15 minutes.
While topping gets crispy, pick and chop the tender fennel fronds to use as a garnish. Allow to cool slightly after baking and garnish with fennel fronds.