This is not an error.
The identified example does _not_ say that it will "return" those
entries. It states it will _exclude_ entries matching either of those
two conditions.
Likewise, the SQL statement referenced is a negation ("and not") of the
condition.
This portion of the documentation
Hello everyone.
https://docs.djangoproject.com/en/3.2/ref/models/querysets/#django.db.models.query.QuerySet.exclude
The second example mentions that the query will return entries *whose *
pub_date* is later than 2005-1-3 **O**R **whose headline is “Hello”.*
*But the equivalent SQL statement ment