Preheat oven to 350 degrees. Grease a 2 to 2 1/2-quart baking dish.
Steam green beans until crisp-tender; place in an ice water bath to stop the cooking. Drain, and pat dry with paper towel. Set aside.
In a medium saucepan, melt 2 tablespoons of the butter over medium heat. Add chopped onion, season with salt and pepper, and cook, stirring often, for 2 minutes. Add garlic, reduce heat to medium-low, and continue cooking, stirring often, until onion is soft and beginning to turn a light brown color (12 to 15 minutes).
Reduce heat to low, add flour, and cook for 3 minutes, stirring constantly. Slowly stir in milk until absorbed and smooth. Increase heat to medium-low and continue cooking, stirring constantly, until the sauce thickens.
Stir in cheese and cook, stirring constantly, until the cheese is melted and the sauce is smooth.
Remove sauce from heat and stir in the sour cream, sherry, and lemon zest. Season to taste with salt and pepper. Stir in beans and spoon mixture into the prepared baking dish.
Melt the remaining 1 tablespoon of butter and toss with shallots, bread crumbs, parsley, and paprika. Sprinkle evenly over top of casserole. Bake until bubbly hot and browned on top, around 20 minutes.