Preheat your oven to 375°F (190°C) and lightly grease a 9x13-inch baking dish.
In a large skillet over medium-high heat, cook the ground beef, chopped onions, and minced garlic. Use a spoon to crumble the beef as it cooks.
Continue until the beef is fully browned and the onions are soft, about 8-10 minutes.
Drain any excess grease from the skillet and set aside.
Cook the frozen broccoli according to the package directions until tender-crisp.
Drain it thoroughly to remove all excess water.
While the broccoli cooks, prepare the cheese sauce.
In a small saucepan over low heat, combine the softened cream cheese, heavy cream, and grated Parmesan cheese.
Stir constantly until the cheeses are completely melted and the sauce is smooth and creamy.
Season with salt and pepper to your liking.
In a large mixing bowl, combine the cooked beef mixture, the drained broccoli, and the creamy cheese sauce. Gently fold everything together until well combined.
Pour the mixture into your prepared baking dish and spread it into an even layer.
Sprinkle the shredded mozzarella cheese evenly over the top, followed by the red pepper flakes, if you're using them.
Bake for 15 to 20 minutes, or until the casserole is hot and bubbly and the mozzarella on top is melted and lightly golden brown.
Let it rest for a few minutes before serving.