Preheat your oven to 375°F and grease a 9x13-inch baking dish.
In a large pot of boiling water, cook the gluten-free pasta 2 minutes less than package directions (e.g., if it says 10 minutes, cook for 8). Drain and toss with 1/4 of the tomato sauce to prevent sticking.
In a mixing bowl, beat an egg lightly, then stir in the ricotta, Parmesan, half of the mozzarella, basil, salt, and pepper. Set aside.
In another bowl, whisk together the tomato sauce with the tomato paste until smooth.
Layer 1/3 of the tomato sauce in the baking dish. Add half of the pasta in an even layer. Top with half of the ricotta mixture, spreading gently, and sprinkle with 1/3 of the remaining mozzarella.
Repeat the process with another layer of sauce, pasta, ricotta, and mozzarella. Finish with a top layer of sauce and the remaining mozzarella and Parmesan.
Bake for 30-35 minutes until the cheese is golden brown and bubbling. Cool for 10 minutes before serving.