Preheat the oven to 350°F and position a rack in the middle.
Lightly grease a 9×13-inch deep casserole dish with cooking spray and set aside.
Heat a large skillet over medium-high heat and add 2 tablespoons oil once hot.
Add the ground beef and sear without stirring for 1 minute, then break up with a wooden spoon and cook, stirring, about 5 minutes until no longer pink. Drain excess grease, leaving about 2 tablespoons in the pan.
Add the diced onion, diced green bell pepper, minced garlic, diced green chiles, 3 cups salsa, and taco seasoning to the beef; season with salt and pepper.
Stir, bring to a simmer for about 2 minutes, then reduce heat to low and cook 5–7 minutes.
Whisk the cornstarch with 4 tablespoons water until dissolved, stir into the beef mixture, and cook 2–3 minutes until slightly thickened.
Remove the skillet from heat and set aside.
Arrange two tortillas in the bottom of the prepared pan. Cut one tortilla into quarters and tuck the quarters into the corners; cut another tortilla in half and tuck the halves along the sides to cover gaps.
Spoon and spread half of the refried beans over the tortillas.
Spread half of the beef mixture over the beans in an even layer.
Spoon half of the drained black or pinto beans over the beef.
Sprinkle 1 1/2 cups shredded Mexican cheese over this layer.
Repeat the layers: tortillas, remaining refried beans, remaining beef mixture, remaining black or pinto beans, and another 1 1/2 cups cheese.
Top with a final layer of tortillas, spread 1 cup salsa over them, and sprinkle 1 cup shredded Mexican cheese on top.
Bake in the preheated oven for 30 minutes, then broil 2–3 minutes until the cheese is golden and bubbly.
Remove from oven and cool on a rack 30–40 minutes before slicing into 8 slices.
Garnish each slice with chopped cilantro and a dollop of sour cream if desired.