Dice the onion and mince the garlic. Slice the carrots and celery into small chunks. Chop the red pepper and zucchini and slice the mushrooms.
Spray a 9x12-inch baking dish with cooking spray. Add the onion, garlic, carrots, celery, red pepper, rice, diced tomatoes, boiling water, Italian seasoning, fennel seeds, salt, and pepper. Stir and put into the oven uncovered, for 15 minutes.
Pull the baking dish out of the oven and add the zucchini, mushrooms, and red lentils. Cook for 40 more minutes and check to see if your rice is done. If it still is a little crunchy, remove the dish from the oven and add ½ cup more water if needed and cook for 10 to 15 more minutes. Add a layer of cheese if desired and put it back into the oven to melt. The casserole is ready to serve. Top with fresh basil and Parmesan cheese if desired.