I found that using the console variable r.OneFrameThreadLag 0 to turn off the render delay after one frame alleviated the problem but it still sometimes caused problems
The method I am using now is to manually tick the cache time. For example, if I need to render a video of 25 frames, I set the frame rate to 75 frames, sample all the hair animations of the 2nd frame at 1-3 frames, sample the 5th frame at 4-6 frames, and set the interval of 3 frames in the movie rendering queue.