Your answer lies in how the Academy defines the Original Screenplay category.
Over the years, that definition has itself shuttled back and forth. For instance, here's how the category was viewed in the 70s.
1973 & 1974: Writing (Story and Screenplay–based on factual material or material not previously published or produced)
1975 & 1976: ...
Ethan Hawke discussed this with Collider:
He also revealed, “We had a version of [Before Sunset] that happened two
years later. But once it took us five years and we can’t get the
money to make that movie we have to rethink it. So elements or lines
from that script stayed. When we first finished Before Sunset there
was an idea that we would do. ...