What causes the colour when conducting flame tests on solid salts?
There is a very detailed discussion of what cause the emission lines in flames with $\ce{NaCl}$ in The Origin of the Spectra (ironically by P. Darwin Foote et al.) 1922, starting around page 165.
They are saying that for $\ce{NaCl}$ most of the transitions are from atomic $\ce{Na}$, the $\ce{NaCl}$ having vaporized, and Na+ then captured an electron, and a small fraction of the transitions are from the act itself of Na+ capturing the electron.
They calculate that a Na atom emits 2000 D-line quanta per second.
They also calculate the fraction of Na atoms with electrons in the $3p$ state is $\ce{10^{-11}}$ at 1000K, rising to $\ce{10^{-7}}$ at 1500K. (Note: the book says &quot;$2p$&quot;, but $2p$ in Fowler notation is $3p$ in modern notation)
Also, they say the vapor pressure of $\ce{NaCl}$ in a Bunsen flame is on the order of $\ce{10^{-6} \ mmHg}$.
So the color is from vaporized $\ce{NaCl}$ (vapor phase $\ce{NaCl}$ being molecular), that has dissociated and formed atomic $\ce{Na}$.
Also in The Absorption of Light by Flames Containing Sodium Phys. Rev. 38, 699 (emphasis added):

The dissociation probably occurs in two or more steps. Possibly the
molecules break up into sodium and chlorine ions which then lose their
charges becoming uncharged atoms. There may also be one or more
intermediate steps in the recombination.  But certainly the sodium
giving the light which we are studying consists of uncharged atoms, as
is evident from its spectrum. Evidence that there are comparatively
few charged sodium atoms in the flame is given by a study of the
conductivity of flames. Wilson, (p. 85) for example, estimates that
only 1.6 percent of the sodium in a fame is ionized even when the
concentration is small.
It also seems reasonable to assume that at the
edge of the flame there is more complete dissociation of the salt than
in the center, and that this is the cause of the difference between
the concentration ratios obtained with light from the center and from
the edges. A fairly definite proof that there is more dissociation at
the edges is given by the appearances of a fame into which copper
chloride is being sprayed. Such a fame gives almost no green color
except at the edges, where it is a bright green. This is the more
noticeable if there is a small amount of sodium impurity in the copper
chloride. The center of the flame is then yellow with a distinct border
of green.
The greater dissociation at the surface is no doubt in some way due to the greater amount of air there, but whether it is caused by a higher temperature
or by a difference in chemical action can not at present be stated.