Heat oven to 400°F (205°C).
Melt 2 tablespoons (28 grams) butter in a saute pan over medium heat. Add mushrooms and onions and cook, stirring occasionally, until they are cooked down, about 8–10 minutes. Add garlic, salt, and pepper, and cook for an additional minute. Turn heat to medium low. Stir in flour, and cook for 1–2 minutes.
Stir in chicken stock and heavy cream. Allow the mixture to cook, stirring often, until a thick sauce forms, about 10–12 minutes. Stir in green beans, and cook until warmed.
Transfer the green bean mixture to a 9 x 9 inch (23 x 23 cm) baking dish.
Melt the remaining 2 tablespoons (28 grams) butter in a mixing bowl. Add crispy fried onions and panko to melted butter, and stir to combine. Top green beans with the onion mixture.
Cook uncovered for 8–12 minutes until golden brown on top. Serve immediately, or cover with aluminum foil to keep warm.