Looking at OpMoveCursor, I see
  selectedRange = odtDocument.convertCursorToDomRange(position, length);
This would be the point where OpMoveCursor should found out if the input is valid or not.
And at this point, invalid input might not only be a programming error, it might also be a participant sending invalid data.