Can UStaticMesh.bAllowCPUAccess be set in C++ code on runtime?

I’m using the new mesh slice feature. I got a lot of StaticMesh which bAllowCPUAccess is not set.
After I cooked the release build, the game crashed at

MyGame!UKismetProceduralMeshLibrary::GetSectionFromStaticMesh()
MyGame!UKismetProceduralMeshLibrary::CopyProceduralMeshFromStaticMeshComponent()

I tried to set bAllowCPUAccess in code:

staticMesh->bAllowCPUAccess = true;

This line is correct in syntax, but the game still crashed at the same line.

So the question is:

Since I don’t want to set all of meshes’ bAllowCPUAccess manually (it’s boring, and I’m worry about it may slow down the game?),

is there a way to let me use CopyProceduralMeshFromStaticMeshComponent with static meshes’ bAllowCPUAccess not set before build (e.g. copy and create a new StaticMesh which bAllowCPUAccess is set when creating), or I can only set bAllowCPUAccess in Editor before build? If so, why bAllowCPUAccess is settable in code ( staticMesh->bAllowCPUAccess = true; ) ?

Thanks in advance.