So I have found after doing a number of moves of classes, all written in Groovy. That IntelliJ seems to lose track on what classes import what classes, such that if I move one class to a different package. Any class that had an import statement does NOT get updated and is still pointing to the wrong package, the old package. Or if you delete a class through safe-delete, that it won't find that it is being imported in another class and delete the class, but doesn't delete the import statements in other classes that import that class you just deleted.
It can be frustrating when you have to do a major refactoring job that will change lots of classes at once. I have had some refactors that would change anywhere from 40 to 500 classes in one refactor. But there will always be some of these imports that are just wrong and never updated, which I know from other experiences does not happen when those classes are written in Java.