C++ - Dynamically created components are disappearing

I opened a new project and tried the code in it. now it works, BoxComponents do not disappear. But there is a new problem, I can’t save scene after placing the actor in scene. I get following error;

Video