Thermal Focus Shift (TFS) occurs in telescopes and even some long-focal length lenses as the telescope or lens cools down overnight. Early in the evening, you may reach perfect critical focus, only to find that your lens or telescope is out of focus again a couple of hours later.
As the telescope cools down, it contracts, causing your camera’s sensor to move outside of the plane of sharp focus. Below is an example of what TFS looks like.
This video is composed of 60 two-minute exposures of the Trifid Nebula. As the telescope cooled down over a period of two hours, the focus worsened. You can see the obstruction of the secondary mirror begin to appear as the stars shift out of focus.
The only way to compensate for this is to either periodically check your focus during your imaging session (which can be a MASSIVE pain if you’re shooting longer sub-exposures) or use an autofocus system, like this one: