Preheat oven to 350°F. Spray a 9×13-inch baking dish with nonstick spray.
In a large bowl, combine the potatoes, butter, shredded cheese, and sour cream. Mix well and set aside.
In a medium, non-stick skillet over medium heat, melt butter.
Add onions and cook until softened (3-5 minutes). Add the garlic and cook for one more minute.
Add flour, salt, pepper, cayenne pepper, and dry mustard. Cook another minute.
Slowly add milk and chicken broth, whisking until well combined. Continue to cook, whisking until thickened.
Pour the sauce into the potato mixture. Mix well. Then, pour into the prepared baking dish.
Bake 45-50 minutes, until the casserole is bubbly and heated through.
While the casserole is baking, prepare the fried onions.