Preheat the oven to 425 degrees F.
Melt two tablespoons of butter in a large saucepan over medium heat. Add the fennel, season with salt, stir, then cover and let cook for about 10 minutes.
Add the onions, stir, cover, and cook, stirring occasionally, until tender, about 15 minutes.
while the fennel and onion cook, melt the remaining two tablespoons of butter in a medium saute pan.
Add in the panko breadcrumbs and stir around until they're golden and toasted. Set aside to cool.
When the onions and fennel are tender, add the heavy cream and thyme, then season with salt and pepper.
Cook uncovered for a few minutes until the cream has reduced by about ⅓, then remove from the heat and stir in 1 cup of Pecorino Romano cheese.
Butter the inside of an 8-9 inch casserole dish or cast iron skillet, then add the fennel mixture and smooth out the top.
Sprinkle with remaining Pecorino Romano cheese and then the toasted breadcrumbs.
Bake for about 20 minutes or until its bubbling and golden brown on top.