Preheat the oven to 350 degrees F. Spray a 13-by-9-inch baking dish with nonstick cooking spray.
In a large skillet over medium-high heat, heat the olive oil. Add half of the sliced onions and cook 5 minutes, stirring frequently. Reduce the heat to medium. Cook until the onions are dark golden brown, 10 to 15 minutes, stirring frequently. Sprinkle with 1 1/2 tablespoons brown sugar and the cayenne. Remove with a slotted spoon and repeat the procedure with the remaining half of onions. Add more oil, if needed, and the remaining 1 1/2 tablespoons brown sugar. Drain well, and combine the onions, tossing well.
In a small saucepan, melt the butter over medium heat. Sprinkle with the flour and stir well with a whisk. Cook 2 minutes, stirring constantly. Gradually whisk in the half-and-half, stirring constantly. Add in the mustard, paprika, pepper and salt. Cook, stirring frequently, until thickened. Remove from the heat.
In the prepared baking dish, layer in the ingredients in this order: half of potatoes, half of sauce (about 1 cup sauce) and 1 cup Parmesan. Repeat with the remaining potatoes, cheese, sauce and top with the reserved onions. Cover with aluminum foil and bake until the potatoes are tender when pierced with a knife, about 30 minutes. Remove the foil and bake until bubbly and the cheese is melted, about more 15 minutes. Remove from the oven and let stand for 10 minutes before serving. Sprinkle with parsley.