Preheat the oven to 375 degrees F. Butter an 8 by 8-inch baking dish. Melt the butter in a large skillet over medium-high heat. Add the onion and a pinch of salt. Saute for 3 minutes, then add the garlic and red chili flakes and saute for 2 more minutes. Add the heavy cream, Parmesan, and nutmeg. Heat until the cream is just beginning to bubble, stirring often. Turn the burner off and stir in sour cream and spinach. Adjust the seasoning with salt and pepper, to taste. Pour into the prepared baking dish and sprinkle the top evenly with fried onions. Bake until golden and bubbly, 15 to 20 minutes.