Why won't my save and load c++ code work?

Have you checked whether there are any errors/warnings in the log when it doesn’t work?
Also, UGameplayStatics::SaveGameToSlot returns a bool - what is it returning in your case?