I got the same error message from Unreal Engine editor when I try to create a class in a custom subfolder. Mainly, I saw neither my subfolder nor my created class in UE editor (But in VS solution viewer it was ok).
As Acnologia_Drag said, I checked in the .h and .cpp files the inclusion path of the header and I were able to corroborate that .cpp file includes wrong path (automatic class code generator added subfolder path and caused double folder path inclusion, for example real path was “src/custom/customclass.h” and path generated was “src/custom/customclass.h”). Just, I deleted that wrong file path from .cpp file, recompiled project from VS and Unreal Engine editor works fine (i could see right subfolder with class inside).
I post this if somebody else got the same message following the same steps and want to fix it.