Why are you changing from after on your 2nd request, to before on your 3rd? Using before is only for paginating backwards through previous pages of results you’ve already gone past.
You should keep using after and keep replacing the value with the cursor in your last request.
Not all endpoints properly support before cursors. I haven’t tested with Get Clips, but it could simply be one of the endpoints that doesn’t allow using before and the documentation could incorrectly list it as a param.
Also, if you want to get pages 1, 2, and 1 again, rather than using before you should just make the request without any cursor and it will give you page 1. Generally for most use cases, such as polling an endpoint, it’s common to just get page 1, keep using after to get as many pages as you need, then the next time you need the data you start from scratch and page through again.
It would be good to add a note in documentation as it is right now a bit confusing. This issue forces to save specific cursors for each page as it is inconvienient if we are on the page number 8 and can’t actually easily go back to page 7.
You shouldn’t be saving cursors and reusing them, otherwise you would get inconsistent results as they’re not designed to permanently represent a place in the results but rather something that’s relevant at the point in time you got the cursor.