Here is what different compounds look while heated up under a flame.

Here is a picture of our results:

I think that in order of the pictures, 1 is copper, 2 is Strontium, 3 is Sodium, 4 is Rubidium, 5 is Zinc, and 6 is Calcium.
Question 1: Each element has a different amount of electrons in its shells, and when they are heated up, they produce energy in the form of color, each element producing a different color.
Question 2: This color that is produced is related to the colors it produces in the form of a light spectrum. The colors that are apparent from the element’s spectrum are the same as the one in the flame test.
Question 3: See Above
Error analysis: I think that there could be left over, or residue of the previous elements on the wire which could have altered the overall color.