Preheat the oven to 375°F (190°C). Place the cauliflower florets on a sheet pan. Drizzle with 1 tablespoon of the olive oil and sprinkle with 3/4 teaspoon salt and 1/2 teaspoon pepper. Toss well, arrange in one layer, then bake, tossing halfway through, until the cauliflower is tender and starts to brown, about 25 minutes.
Meanwhile, heat a medium saucepan over medium heat. Add the remaining 1 tablespoon olive oil and 1 tablespoon of the butter. When the butter has melted, add the onion and cook until they’re softened and translucent, 2 to 3 minutes. Stir in the heavy cream and sour cream, then continue stirring while the mixture bubbles and thickens to the consistency of a milkshake, 2 to 3 minutes. Stir in the garlic powder and 3/4 teaspoon salt, 1/4 teaspoon pepper, and half of the Gruyere and half of the Parmesan cheese. Remove the cheese sauce from the heat and set aside.
Grease a small (2-quart) casserole dish with 1 tablespoon of the butter. Spread the roasted cauliflower into the prepared dish, then pour the cheese sauce over the cauliflower.
Make the topping: In a medium bowl, combine the remaining Gruyere and Parmesan cheese and the almonds and green onions. Melt the remaining 2 tablespoons of butter and pour it over the cheese-almond mixture, then toss to combine. Evenly distribute the topping over the cauliflower.
Cover the gratin with aluminum foil and bake for 15 minutes. Remove and uncover the gratin, turn on the broiler and set a rack about 5 to 6 inches from the heat source, then broil the gratin until golden and bubbling, 1 to 2 minutes. Remove and serve.