C++ Actor spawn error

Hello, I have recently started to learn how to code with c++ in ue5 and faced the problem. I want to spawn an actor from gamemode. In .h file ir declared an actor:

UPROPERTY(EditDefaultsOnly)
TSubclassOf<AActor> WallClass;

And in .cpp file in BeginPlay function tried to call spawn function:

FVector SpawnLocation = FVector(0, 0, 0);
FVector SpawnScale = FVector(1, 1, 1);
FTransform SpawnTransform = FTransform(FRotator(), SpawnLocation, SpawnScale);

GetWorld()->SpawnActor<AActor>(WallClass, SpawnTransform);

Both of these files have their blueprint child’s so I can easier choose which actor I want to spawn. In Gamemode blueprint file I set the actor blueprint file:
image_2024-04-03_164017299

But When I start the game error shows in output log: “LogSpawn: Warning: SpawnActor failed because no class was specified”

Can anyone say what I did wrong?

If needed I can show more code or images from blueprints.