BUG: dtype query with negation bug (GH8568)