Preheat your oven to 400°F.
Bring a large pot of salted water to a boil. Add the gnocchi and cook according to the package instructions, or until they float to the surface. Drain and set aside.
Heat a large oven-safe skillet over medium-high heat. Add the ground beef and diced onion. Cook until the beef is browned and the onion has softened, breaking up the meat as it cooks. Drain any excess grease.
Stir in the minced garlic, granulated garlic, Italian seasoning, and red pepper flakes, if using. Cook for 30 seconds, then add the marinara sauce and fresh basil. Cover and cook over medium-low hear for 15-20 minutes.
Meanwhile, combine the ricotta cheese, egg, parsley, and Parmesan cheese in a medium bowl. Season with salt and pepper and mix until well combined.
Once the meat sauce is done cooking, check for seasoning and add salt and pepper if needed. Stir the cooked gnocchi into the meat sauce until evenly coated. If your skillet isn't oven-safe, transfer everything to a baking dish.
Spoon dollops of the ricotta mixture evenly over the gnocchi, then sprinkle the mozzarella cheese and freshly grated parmesan cheese over the top.
Bake uncovered for 15 minutes, or until the sauce is bubbling and the cheese has melted.
Broil for 1–2 minutes, or until the cheese is golden brown. Keep a close eye on it to prevent burning.
Remove from the oven and let it rest for 10 minutes. Garnish with fresh basil and serve.