Looking at the supposed radar track of the SU-24 (if it is in fact accurate and not altered propaganda), and considering the remoteness of the terrain, it looks like the Russian air crew made a mistake, double-backed, and then accidentally recrossed back over a tiny sliver of Turkish territory, where the F-16s were waiting in ambush.
There was really no reason for the Turks to fire first, since the bombers were not deep inside Turkey, and were no threat to the Turks themselves.
Regardless, there's going to be hell to pay now...