Preheat your oven to 350°F / 175°C.
Bring a large pot of salted water to a boil. Blanch the green beans for 1 minute until bright green, then drain and immediately rinse with cold water to stop the cooking process.
Set aside.
In a large, oven-safe skillet, melt the ghee over medium-high heat.
Sauté the sliced onion for 2-3 minutes until fragrant and softened.
Transfer the cooked onions to the bowl with the blanched green beans.
Return the same skillet to the heat.
Add the heavy cream, cream cheese, and minced garlic.
Whisk continuously until the cream cheese is fully melted and the sauce is smooth, about 5 minutes.
Stir in the sliced mushrooms and simmer for another 5-7 minutes, allowing the sauce to thicken slightly.
Season generously with salt and pepper.
Gently fold the green beans and sautéed onions back into the skillet, stirring with a spatula until everything is evenly coated in the creamy sauce.
Transfer the skillet to the preheated oven and bake for 25-30 minutes, or until the casserole is bubbly and the green beans are tender.
Serve hot. Leftovers can be stored in an airtight container in the refrigerator for up to 5 days.