Shred the zucchini using a food processor, or grate it by hand. You should end up with a little over 2 cups of shredded zucchini. Spread in a single layer on paper towels and place additional towels on top. Press gently to absorb excess water. Let zucchini sit while preparing the beef.
Set the Instant Pot to sauté mode. Once hot, add the ground beef. Cook, breaking up clumps with a wooden spoon, until most of the pink is gone, about 2-3 minutes. Drain excess fat if needed. Press cancel.
Add the salt, pepper, basil, and minced garlic to the beef. Stir well.
Add the shredded zucchini to the ground beef mixture, stirring to combine.
Lay the mushrooms on top of the mixture, then pour in the marinara sauce. Do not stir.
Close the lid and seal the vent. Cook on low pressure for 10 minutes. When time is up, immediately perform a quick release by carefully turning the valve to 'venting' to release the steam. Press cancel.
Remove the lid and stir the mixture thoroughly. Add 1 cup of the shredded mozzarella and the ricotta cheese. Stir until combined and thickened with liquid absorbed.
Preheat the oven to broil. Transfer the mixture to an oven-safe baking dish (any size). Top with the remaining shredded mozzarella. Broil for 3-5 minutes, until the cheese is melted and bubbly.
Take the casserole out of the oven and let it rest for 5-10 minutes before serving.