Spray 13x9-inch (3-quart) glass baking dish with cooking spray. In large skillet, melt butter over medium heat. Cook mushrooms and onions in butter 5 to 7 minutes or until tender, stirring frequently. Add shrimp; cook until shrimp turn pink, stirring occasionally.
Spread 3 slices bread with pesto. Top each with 1 plain bread slice, pressing firmly together. Cut sandwiches into 1/2-inch cubes. Layer half of bread cubes in baking dish. Sprinkle with half of the cheese. Top with all of the mushroom mixture, crabmeat and artichoke hearts. Top with remaining half of bread cubes and cheese.
In large bowl, beat eggs. Beat in milk, salt and ground red pepper. Pour over bread, pushing bread into milk mixture to moisten completely. Cover; refrigerate 8 hours or overnight.
Heat oven to 350°F. Uncover baking dish; bake 35 to 40 minutes or until knife inserted in center comes out clean. Let stand 5 minutes before serving. To serve, cut into squares. Garnish with thyme.