After investigating it turns out that the errors pops up when operationType is insert. The resume token in the error is not the resume token defined in startAfter, but the resume token from the insert operation. Looks like the real error is not bubbling up correctly, instead a more generic one is thrown.