Preheat oven to 350 degrees F (175 degrees C). Spray a 9x9-inch baking dish with cooking spray.
Arrange pizza squares in the prepared baking dish. Mix eggs, milk, mozzarella cheese, onion, butter, garlic, oregano, and salt together in a large bowl; pour over pizza pieces. Top with Parmesan cheese and red pepper flakes. Cover dish with aluminum foil.
Bake in the preheated oven for 45 minutes. Remove foil and continue baking until eggs are set and Parmesan cheese is melted, about 20 more minutes.