I had the problem where everything built, no error messages and the project opened but, the the classes were missing. After trying all the workarounds on Stackoverflow, Github and in the comments here nothing worked.
I decided to try using Xcode instead of VSC. As soon as I added a new class UE rebuilt and the folder appeared with my new class and the one I previously added.
I have now gone back to VSC and it is working properly too.