Preheat the oven to 180°C. Lightly grease a large casserole dish with non-stick spray or a light coating of oil.
If you are starting with a whole squash, cut off the lower third of the squash (the part where the seeds are) and reserve for another use. Stand the neck of the squash on a chopping board and cut vertically into long strips that resemble wide lasagne sheets, about 3mm, using a mandolin or a long slicing knife.
Bring a sauté pan of salted water to the boil and add the butternut sheets. Simmer for three to four minutes, until al dente but not crumbling. Carefully tip out the water and run cold water over the butternut to stop it cooking. Drain well.
Prepare the spinach: Heat the tablespoon of olive oil in a large sauté pan. Add the onion and cook over a low heat with the lid on until translucent — about 10 minutes. Remove the lid, add the garlic and cook for one minute more.
Add the spinach — in batches if you cannot fit it all in. Cook until all the spinach is wilted and then add the chopped sun-dried tomatoes. Season well with salt and pepper to taste.
In a medium bowl, mix the ricotta and cottage cheese with the thyme leaves and season to taste.
Cover the bottom of the prepared casserole dish with a layer of squash sheets. Top with a third of the ricotta mixture and gently spread it evenly over the squash. Drizzle with a tbsp of the sun-dried tomato oil and season with salt and pepper. Top with half of the spinach mixture, then a butternut, ricotta and oil layer; a spinach layer and top with squash, ricotta and oil. Scatter the grated cheese over the top.
Bake until the filling is bubbly and the top is golden brown, 35 to 40 minutes. Cool for 15 to 20 minutes before serving. Delicious with a side serving of broccoli or crisp green salad.