Heat 1 tbsp of the butter over a medium high heat in a high sided frying pan or a large saucepan. Once the butter is frothy, add the mushrooms and a pinch of salt, and cook until the mushrooms are soft and starting to color.
Add the garlic and cook for a few minutes more until aromatic. Season with black pepper, remove from the pan, and set aside.
Melt the remaining 4 tbsp of butter in the pan. Add the flour, and whisk for a few minutes to remove the ‘raw’ taste from the flour.
Gradually pour in the milk, whisking the whole time, until you have a smooth sauce. Keep on cooking, whisking often, until the sauce is thick enough to coat the back of a spoon.
Remove from the heat before stirring in the heavy cream, nutmeg and shredded parmesan. Whisk until smooth, add the cooked mushrooms, and season to taste with more salt and pepper, if needed.
Halve the green beans so that they fit in the slow cooker better, and transfer them to the cooking insert. Stir in the mushroom sauce.
Cover and cook on low for 4 hours, or until the beans are tender but still retain a little bit of their crunch. Depending on the size and shape of your slow cooker, you may need to stir occasionally during cooking to make sure the beans cook evenly.
Top the casserole with the French onions just before serving.