Preheat the oven to 350°F (175°C) 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 let it sear without moving for 1 minute, then break it up and cook, stirring, about 5 minutes until no longer pink.
Drain excess grease, leaving about 2 tablespoons in the skillet.
Add the diced onion, diced bell pepper, minced garlic, diced green chiles, 3 cups salsa, and taco seasoning; season with salt and pepper.
Stir to combine, bring to a simmer, then reduce heat to low and cook 5–7 minutes.
Whisk the cornstarch with 4 tablespoons water until dissolved, add to the beef mixture, and cook 2–3 minutes until slightly thickened, stirring to prevent sticking. Remove from heat.
Place 2 tortillas in the bottom of the prepared pan, filling gaps by cutting another tortilla into quarters for the corners and halving one tortilla for the sides as needed to cover empty spaces.
Spread half of the refried beans over the tortillas.
Spoon half of the beef mixture over the beans and spread evenly.
Spoon half of the rinsed and drained black or pinto beans over the beef.
Sprinkle 1 1/2 cups shredded Mexican cheese blend over the 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. Watch closely while broiling.
Remove from oven and cool on a rack for 30–40 minutes before slicing.
Garnish each slice with chopped cilantro and a dollop of sour cream if desired.