I had a crystal physically close the a Micro controller which I had to unsolder. I used hot air to remove the micro controller and soldered a new one.
I had a bunch of intermittent fault where most 90% of the time the micro controller would not boot and I could not communicate to it via serial. After a bunch of debugging I could not find what was wrong and deiced to replace the crystal as a last resort.
To my surprise after replacing the crystal everything worked normally. Could the crystal have overheated whie using the hot air to unsolder the microcontroller?
You would have to refer to the datasheet, as it will tell you exactly how long its rated for X temperature for its soldering profile.
There are a few ways it could cause problems, from flux leakage under the crystal (A little leakage can kill low power oscillators). to melting the base or some internal support inside the crystal,
You could have also had a dry joint with the pad under the crystal being heavily oxidised, I've seen weirder multiple times,
The datasheet does nit have any info regarding soldering temps which is wierd.
The flux residue like yoi said could be an issue. When I removed the old crystal there was some residue which I cleaned off. Did not know that could be an issue
Crumpled aluminum foil placed loosely around parts you don't want to get hot works wonders.
As for detecting the cause, don't you check whether the oscillator is running before proceeding in the program?