Binary search finds a boundary in O(log n) steps by ruling out half of what is left each time. It works whenever a yes-or-no question is false up to some point and true after it. "Is this time at least the target?" on a sorted list is one such question. "Can a truck with this load finish in time?" is another, over loads instead of positions.
Pick one interval convention and keep it. Here the answer lives in the half-open range [left, right), with right starting at the length so "past the end" is a valid answer. If the middle can't be the answer, move left past it; if it might be, move right onto it. The loop ends when they meet.
Test the boundaries on purpose: an empty list, a target below or above everything, runs of equal values, and in Java, mid * mid or left + right overflowing an int.