Bring pasta water and its tablespoon salt to a boil in a large pot. Cook shells for the package time until tender, then drain gently and separate on a plate so they do not stick together.
Meanwhile, heat oil in a deep 12-inch skillet over medium heat. Cook half the red onion for 5 minutes, then stir in garlic for 30 seconds. Add tomato sauce, 1/2 cup broth, 1 teaspoon ancho chile and 1/4 teaspoon filling-and-sauce salt; simmer for 8 minutes.
In a second skillet, brown beef and remaining onion for 8 minutes, breaking beef into small crumbles, until it reaches 160°F. Drain excess fat and stir in remaining ancho chile, cumin and remaining filling-and-sauce salt for 30 seconds.
Add refried black beans and remaining 1/4 cup broth to the beef and stir over low heat for 2 minutes until combined. Remove from the heat and stir in lime juice.
Divide filling evenly among the 18 shells. Arrange them open-side up in the tomato sauce in one snug layer, spooning a little sauce between them rather than filling their openings.
Cover and simmer over low heat for 8 to 10 minutes until the filling reaches 165°F. Remove from the heat, scatter cotija over the shells and serve 3 per portion with sauce.