This issue seems to still be present in 4.24.
FIX: to prevent the issue with actor components not following the parent, the declaration must be private,
but using UFUNCTION(meta = (AllowPrivateAccess = “true”)) in the header file, and Component->SetupAttachment must be used after creating the default subobject during construct.
You might need to compile from scratch, close the editor and your IDE, delete the folders Binaries, Intermediate and Saved. Right click the uproject file, regenerate project files. Open the C++ solution and build your project (in the Development Editor configuration). Re-open the UE4 editor.