Heat oven to 350 degrees. Spray a 9x13 baking dish, or similar casserole dish, with cooking spray. Set aside. Melt the butter in a large pot over medium heat. Once melted, add the flour, salt, sugar, and pepper. Stir with a whisk for 1 minute. Stir constantly so it does not burn. Take off the heat and add sour cream, and dried minced onion. Stir together until combined. Add green beans, half the cheese, and half the fried onions. Stir together and pour into prepared baking dish. Top with the remaining cheese and sprinkle with the remaining fried onions. Bake for 30 minutes.