CursorNotFound after some time running large process

Before starting my request, I start a session and a thread that wakeup periodically (10mn) to refresh this session.
Then I use this session in all the long requests.
When the requests are done, I end the session.
(using mongodb 4.2)