Preheat your oven to 350°F (175°C).
In a large skillet, heat the olive oil over medium heat. Add the ground beef and cook until browned, breaking it apart with a spoon, about 5-7 minutes. Drain excess fat if necessary.
Stir in the taco seasoning, black beans, pinto beans, and diced tomatoes. Cook for an additional 5 minutes, allowing the flavors to meld. Season with salt and pepper to taste.
In a 9x13-inch baking dish, spread a thin layer of salsa on the bottom.
Layer 4 tortillas over the salsa, slightly overlapping them.
Spread half of the beef and bean mixture over the tortillas, followed by half of the sour cream and half of the cheese.
Repeat the layers with the remaining tortillas, beef and bean mixture, sour cream, and cheese.
Cover the baking dish with aluminum foil and bake for 25 minutes.
Remove the foil and bake for an additional 10-15 minutes, or until the cheese is bubbly and golden.
Let the casserole cool for 5 minutes before serving. Garnish with chopped green onions if desired.