How to spawn a blueprint actor via C++

It’s too late but anyway. Try to use ObjectToSpawn->GeneratedClass instead of ObjectToSpawn->StaticClass() It worked out for me on UE 5.3