The predicate RefType.inherits(Member) does not work for member types (member classes or member interfaces), see also #5591.
If this is the intended behavior, it should at least be documented.
Currently the compiler does not even permit using a NestedType as argument for inherits.
Edit: However, based on JLS 16 §8.2 member types are "inherited", so it might be good if CodeQL reflected this.