I have this problem with xcode 14.3. I build a very large project and after upgrading xcode (maybe 13?) started having issues with indexing. I've deleted derived data multiple times and sometimes that helps, but not completely.
I've never seen an Apple person actually address this issue that people have. I'm an xcode advocate partially because of the fast tracking of call hierarchy and definitions -- but now that is all mostly gone.