- Preheat an oven to 400°F.
- In a sauté pan over medium heat, brown the sausage for 2 to 3 minutes. Using a slotted spoon, transfer to a large bowl.
- Add the broccoli rabe to the pan and cook until tender, 6 to 8 minutes, adding the wine after 3 minutes. Season with salt, then add the broccoli rabe and cooking liquid to the bowl with the sausage.
- In the same pan over medium heat, warm the reserved garlic oil. Add the onions and thyme, and season with salt and pepper. Cook, stirring occasionally, until the onions are very soft and caramelized, about 15 minutes.
- Using a slotted spoon, transfer to the bowl with the sausage and broccoli rabe; reserve the oil. Add the pasta and garlic to the bowl and season with salt and pepper.
- Spoon half of the pasta mixture into a 3-quart baking dish and dot with half of the ricotta. Top with the remaining pasta and ricotta.
- Drizzle with the reserved oil and sprinkle with the chili flakes. Bake for 20 minutes, then sprinkle with the Parmigiano-Reggiano cheese and bake until hot and golden brown, about 10 minutes more.