According to Wikipedia, the movie is a midquel that takes place between episodes 22 and 23 of the anime.
Having seen both the movie and the anime, I don't recall any connection that made it essential for it to be viewed in this order. I don't recall anything that had happened in the anime to be vital for the movie, and I don't remember anything that happened in the movie to be vital for episodes 23 onwards.
Am I missing something? Or does it fit between episodes 22 and 23 simply because the authors thought about it like that (maybe the authors thought about the timeline like that, although it may be irrelevant?)?