Intermittent 3001 Error When Forcibly Ending a Session Using Video SDK API v2

I am currently using the Video SDK API v2, and I am trying to forcibly end a session using the following method:

PUT /videosdk/sessions/{sessionId}/status
Body: {"action": "end"}

While testing multiple times with participants present in the session,
sometimes the session ends successfully, but other times, I get the following 3001 error, and the session does not end:
data: { code: 3001, message: 'The meeting could not be found or has expired.' }

Are there any specific conditions required to use this API?